i am working on one project and i have a problem with one thing. Webpage that i am going to screen scrape have a ~5-10 sec loading time because of high amount of data.
When i am trying screen scrape with PHP Simple HTML DOM Parser i got no results. Screen is blank. All elements i use is ok, because when i enter another page from the same website which has exactly the same code in the few start lines everything is working.
Is there any chance to wait for website finish loading and then screen scrape.
Thanks
My code is:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<?php
error_reporting(0);
include_once('../../simple_html_dom.php');
function scraping_slashdot() {
// create HTML DOM
$html = file_get_html('http://www.examplepage.com/');
// get article block
foreach($html->find('div[id="rightBlock"]') as $article) {
// get title1
$item['title1'] = $article->find('div.[class="inputHead"]', 0)->plaintext;
$ret[] = $item;
}
// clean up memory
$html->clear();
unset($html);
return $ret;
}
// -----------------------------------------------------------------------------
//output
$ret = scraping_slashdot();
foreach($ret as $v) {
echo $v['title1'];
}
?>
</body>
</html>