diff --git a/ColissimoApi/ColissimoApi.php b/ColissimoApi/ColissimoApi.php index 1152ca7..eda00ca 100644 --- a/ColissimoApi/ColissimoApi.php +++ b/ColissimoApi/ColissimoApi.php @@ -80,7 +80,7 @@ private function getPage($id) */ private function storeTable($data) { - $table = '' . $this->get_string_between($data, '
', '
') . ''; + $table = '' . $this->get_string_between($data, '
', '
') . ''; $unique_id = uniqid(); $filePath = 'temp/' . $unique_id . '.html'; $file = file_put_contents('temp/' . $unique_id . '.html', $table); @@ -103,8 +103,9 @@ private function storeTable($data) */ private function parse($url) { + $url = file_get_contents($url); $dom = new DOMDocument(); - $html = $dom->loadHTMLFile($url); + @$html = $dom->loadHTML(mb_convert_encoding($url, 'HTML-ENTITIES', 'UTF-8')); $dom->preserveWhiteSpace = false; $tables = $dom->getElementsByTagName('table'); $rows = $tables->item(0)->getElementsByTagName('tr');