Recently in doing a query 46 grades of the function, learning Letter network can crawl, but climbed 1000 or so, will appear verification code, had to give up this method. Some people can crawl from the 99 dorm, but they do not want to tell the big God to tell the specific method.
Reply content:
Recently in doing a query 46 grades of the function, learning Letter network can crawl, but climbed 1000 or so, will appear verification code, had to give up this method. Some people can crawl from the 99 dorm, but they do not want to tell the big God to tell the specific method.
Made a demo:http://cet.zy62.com/.
How to use$rs = cet('姓名','准考证号'); var_dump($rs);
function cet($name,$id){ $name = urlencode(mb_convert_encoding($name, 'gb2312', 'utf-8')); $post = 'id=' . $id . '&name=' . $name; $url = "http://cet.99sushe.com/findscore"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, "http://cet.99sushe.com/"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_NOBODY, false); $str = curl_exec($ch); curl_close($ch); $str = iconv("GB2312", "UTF-8", $str); if (strlen($str) < 10) { return false; } return explode(',', $str);}
Version:
If you encounter a verification code, your crawler may not have changed the IP. It's OK to change the IP at around 1000 and continue crawling. A simple verification code can be cracked.