So i've made a few scrapers in my past but every scraper that i made is taking content from non dynamically loaded page. Basically page that is not using any ajax.
But now i am looking for solutions almost 2 days and can't find any. The page that i am trying to download and use information's from have it's content loaded from ajax. So basically when you go to that page it load content, than table that i need to get is loaded with ajax on page load.
And it looks like curl doesn't understand that page content i need is loaded dynamically so i always get boolean:false
or property does not exists
response.
This is the code that i am trying to get.
$requ = require_once( get_template_directory() . '/includes/simple_html_dom.php' );
$getfeed = curl_init();
curl_setopt($getfeed, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($getfeed, CURLOPT_URL, 'http://wizzair.com/');
curl_setopt($getfeed, CURLOPT_RETURNTRANSFER, true);
curl_setopt($getfeed, CURLOPT_CONNECTTIMEOUT, 20);
$str = curl_exec($getfeed);
curl_close($getfeed);
$html = str_get_html($str);
foreach($html->find('div.fare-finder__calendar__days__day__container') as $key => $value) {
print_r($value);
}
So is there a way to make it understand that content is loaded with ajax on that page so at least to make curl wait a few seconds before it loads a page ?