Я пытаюсь создать html-парсер, но когда я загружаю html, я получаю такие предупреждения
Предупреждение: DOMDocument :: loadHTML () [domdocument.loadhtml]: недопустимый символ в CDATA 0x1C в сущности, строка: 1302
Вот код, который я использую
class Parser
{
public $url=null;
public $html=null;
public $tidy=null;
public $head=null;
public $head_xpath=null;
function __construct($url){
$this->url=$url;
$this->html=file_get_contents($this->url);
$this->tidy=tidy_parse_string($this->html);
$this->head=new DOMDocument();
$this->head->loadHTML($this->tidy->head());
$this->head_xpath= new DOMXPath($this->head);
}
}
$x=new Parser("http://www.guardian.co.uk/politics/2012/mar/24/vince-cable-coalition-banking-row");
Я искал и нашел константу LIBXML_NOCDATA, но я не знаю, как ее установить.
Так как же я могу полностью игнорировать CDATA?