I am trying to scrap few data from http://iunlocker.net/check_imei.php this link.
This page have contains post method and captcha on it and it is also using a cookie. I just made inspect element and checked in network, Cookie is setting in header
Please can someone tell me, What mistake i am making there in code?
$ch = curl_init();
$imei="013977000272744";
curl_setopt($ch, CURLOPT_URL,"http://iunlocker.net/check_imei.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_COOKIE,'_ym_uid=1460051101134309035; _ym_isad=1; cxx=80115415b122e7c81172a0c0ca1bde40; _ym_visorc_20293771=w');
curl_setopt($ch, CURLOPT_POSTFIELDS,array(
'imei'=>$imei,
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
echo $server_output;
curl_close ($ch);
Example IMEI 013977000272744 for manually checking.
You correctly note that the page has a CAPTCHA but you don't include the response for it in your POST data (it would be g-recaptcha-response
). But the whole point of CAPTCHAs is that you have to be a human to solve them, so unless you set up your script to pass the CAPTCHAs on to a human for solving this isn't going to work.