Fatal error: Call to a member function query() on a non-object in /home/kelownae/public_html/admin/advanced_html_dom.php on line 31
I have a simple file that loads all the links from Google.com. As soon as I replace the object and the include file to advanced_html_dom.php instead of simple_html_dom.php, I get above error.
Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /home/kelownae/public_html/admin/advanced_html_dom.php on line 58 and defined in /home/kelownae/public_html/admin/advanced_html_dom.php on line 33
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Fatal error: Call to a member function query() on a non-object in /home/kelownae/public_html/admin/advanced_html_dom.php on line 31
I have a simple file that loads all the links from Google.com. As soon as I replace the object and the include file to advanced_html_dom.php instead of simple_html_dom.php, I get above error.
Can we have a sample file by any chance?
This works:
This does not work:
Last edit: Natalia Usselman 2014-03-08
I haven't added load_file yet, look for it in the next version, and for now try:
$html = file_get_html('http://www.google.com/');
Then I get
Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /home/kelownae/public_html/admin/advanced_html_dom.php on line 58 and defined in /home/kelownae/public_html/admin/advanced_html_dom.php on line 33
That happens when you try to query a null node. For example:
$a = $html->find('a', 0);
$img = $a->find('img', 0); // will fail if $a is null