Решена проблема кодировок
This commit is contained in:
@ -27,7 +27,7 @@ class ContingentParser
|
||||
{
|
||||
libxml_use_internal_errors(true);
|
||||
$dom = new \DOMDocument();
|
||||
$dom->loadHTML($html);
|
||||
$dom->loadHTML(mb_convert_encoding($html,'HTML-ENTITIES','UTF-8'));
|
||||
$this->xpath = new \DOMXPath($dom);
|
||||
$this->template = $template;
|
||||
}
|
||||
@ -39,9 +39,9 @@ class ContingentParser
|
||||
if (!is_array($tag)) {
|
||||
$data[$field] = $this->xpath->query($this->template . $tag . "[@itemprop=\"$field\"]");
|
||||
} else {
|
||||
$x = $this->xpath->query($this->template . $tag[0] . "[@itemprop=\"$field\"]");
|
||||
$y = $this->xpath->query($this->template . $tag[1] . "[@itemprop=\"$field\"]");
|
||||
$data[$field] = $x > $y ? $x : $y;
|
||||
$th = $this->xpath->query($this->template . $tag[0] . "[@itemprop=\"$field\"]");
|
||||
$td = $this->xpath->query($this->template . $tag[1] . "[@itemprop=\"$field\"]");
|
||||
$data[$field] = $th > $td ? $th : $td;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user