CURL寫爬蟲確實很方便。不過不同網站防扒策略不一樣,
PHP爬蟲相關的代碼可以參考一下 https://github.com/best90/php-spider-dev
PHP爬蟲相關的代碼可以參考一下 https://github.com/best90/php-spider-dev
2018-02-05
CURL寫爬蟲確實很方便。PHP爬蟲相關的代碼可以參考一下 https://github.com/best90/php-spider-dev
2018-02-05
CURL寫爬蟲確實很方便。PHP爬蟲相關的代碼可以參考一下 https://github.com/best90/php-spider-dev
2018-02-05
慕課網改用https協議了,要加上:
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
2017-12-30
老師代碼里的網址和視頻展示的不一樣,正確的應該是http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?op=getWeatherbyCityName
2017-12-30
缺少參數時將$data改成 $data = 'theCityName=&theCityCode=&theUserID=';
2017-12-14
$data="theCityCode=北京&theUserId=";
curl_setopt($curl, CURLOPT_URL, "http://ws.webxml.com.cn/WebServices/WeatherWS.asmx/getWeather");
curl_setopt($curl,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
要做一下改動
curl_setopt($curl, CURLOPT_URL, "http://ws.webxml.com.cn/WebServices/WeatherWS.asmx/getWeather");
curl_setopt($curl,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
要做一下改動
2017-11-30