标签:
1. 简单的爬虫
1. xampp开启php的cURL -> xampp/php/php.ini 搜索curl去掉分号即可
2. cmd D: -> cd xampp -> cd php
php -f ../htdocs/mirror/curl/curl.php > ../htdocs/mirror/curl/haha.html (将爬下来的数据保存在haha.html中)
// ../htdocs/mirror/curl/curl.php <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.baidu.com"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); //将输出文件中百度替换成屌丝 echo str_replace("百度", "屌丝", $output); ?>
2. 访问WebService
http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx
标签:
原文地址:http://www.cnblogs.com/iMirror/p/4318855.html