i tried to scrape this page: http://eshop.saphokft.hu/shop/Productslist.aspx?CategoryCode=sprchove-zasteny
i tried to load 9. page from navi with PHP cURL, but i is not working.
i can just 1-8 scrape, but i cannot step from 8 to 9. page.
what is the problem? I tried to with phantomJs and simple PHP cURL.
function downloadUrl($url){
//$content = 'error';
$client = Client::getInstance();
//$p = explode(':', $proxy);
//$Proxy = $p[0];
//$proxyPort = $p[0];
//$client->getEngine()->addOption("--proxy=176.61.143.43:80");
//$client->getEngine()->addOption("--proxy-auth=".$proxyUser.":".$proxyPassword."");
$client->getEngine()->setPath('/home/admin/web/xyz/public_html/bin/phantomjs');
//$client->getEngine()->addOption("--proxy=".$proxy."");
//$client->getEngine()->addOption("--proxy-auth=".$proxyUser.":".$proxyPassword."");
$client->getEngine()->addOption("--proxy-type=http");
$file = '/home/admin/web/xyz/public_html/stemp/pcookies.txt';
$client->getEngine()->addOption('--cookies-file='.$file);
$request = $client->getMessageFactory()->createRequest();
$response = $client->getMessageFactory()->createResponse();
//$request->setMethod('GET');
$data = array(
'ctl00$ScriptManager1' => 'ctl00$MainContent$UpdatePanel2|ctl00$MainContent$pagerTop$ctl01$ctl02',
//'ctl00$HiddenSearchCategory' => '#all',
//'ctl00$searchtext' => '',
//'ctl00$MainContent$HiddenFilter' => '[{"filterValue":"sprchove-zasteny","filterType":"pcategoria"},{"filterValue":"ctvrtkruhove-zasteny","filterType":"categoria"}]',
//'ctl00$MainContent$ex2' => '7990,686990',
//'min' => '7990',
//'max' => '686990',
'ctl00$MainContent$HiddenField1' => 'PageChanged',
'__EVENTTARGET' => 'ctl00$MainContent$pagerTop$ctl01$ctl02',
'__VIEWSTATE' => '',
'__VIEWSTATEGENERATOR' => '5956E682',
'__VIEWSTATEENCRYPTED' => '5956E682',
'__ASYNCPOST' => 'true',
);
$request->setMethod('POST');
$request->setUrl($url);
$request->setRequestData($data);
$client->send($request, $response);
if($response->getStatus() === 200) {
$content = $response->getContent();
}
return $content;
}