- This topic has 1 reply, 2 voices, and was last updated 6 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Info & Off-Topic Discussion › How can I parse HTML with Simple HTML DOM Parser
I have a site that I need to parse with Simple HTML DOM Parser that is something like this:
…
…
This is my code right now:
include(‘./simple_html_dom.php’);
$html = file_get_html(‘http://www.domain.com/subsite’);
$searchResults = $html->find(‘table[@class=search-results’);
foreach($searchResults->find(‘tr[@id^=ad-]’) as $tr) {
…
}
The difficult is that I catch this error right now:
mod_fcgid: stderr: PHP Fatal error: Call to a member function find() on a non-object in /data/domains/mydomain/web/webroot/path/to/script.php on line 31
$html is not null, I already debugged it. I get the same result if I use this code for the table finding:
$searchResults = $html->find(‘.search-results’);
What could be the problem? Is there any person who can guide me in it!
@lujashahd external references are not allowed.
Please be careful.