文件名称:Goutte-masterWeb抓取器PHP类.zip
文件大小:9KB
文件格式:ZIP
更新时间:2022-07-31 04:48:04
类库下载-Goutte-masterWeb抓取器PHP类
<?phpclass Curl{ public $cookieJar =""; public function __construct($cookieJarFile = 'cookies.txt') { $this->cookieJar = $cookieJarFile; } function setup() { $header = array(); $header[0] ="Accept: text/xml,application/xml,application/xhtml xml,"; $header[0]. ="text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; $header[] ="Cache-Control: max-age=0"; $header[] ="Connection: keep-alive"; $header[] ="Keep-Alive: 300"; $header[] ="Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; $header[] ="Accept-Language: en-us,en;q=0.5"; $header[] ="Pragma:";//browsers keep this blank. curl_setopt($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');首先,你获取或者将你的请求发送到指定的URL接下来你将收到作为响应返回的html最后,你将从html中分析你想要抓取的文本。
【文件预览】:
Goutte-master
----README.rst(3KB)
----Goutte()
--------Client.php(6KB)
--------Resources()
--------Tests()
----phpunit.xml.dist(563B)
----.travis.yml(349B)
----box.json(428B)
----LICENSE(1KB)
----.gitignore(33B)
----composer.json(862B)