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