I am simply building a script that checks a page for certain content, and I am running into a problem with the Zend methods. Here is the function in question:
function parse_html($html) {
$dom = new Zend_Dom_Query($html);
$table_rows = $dom->query('tr');
foreach ($table_rows as $table_row) {
$table_row->query('td.startTimeDateColumnHeader')->nodeValue;
}
}
However I am getting this error:
Call to undefined method DOMElement::query()
in regard to this line:
$table_row->query('.startTimeDateColumnHeader')->nodeValue;
Any ideas?
the error is telling you that the php class DOMElement does not have a method named query that is callable.
To explain: you performed a query on a DOM document using Zend_Dom_Query the result returned was in the form of DOMElements and DOMNodes so query() is no longer available.
You’ll probably need to do something like:
I may have selected the wrong method, but I hope you get the idea.