首頁 > 後端開發 > php教程 > php抓包有什么好的工具提取抓取的页面信息??

php抓包有什么好的工具提取抓取的页面信息??

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
發布: 2016-06-06 20:26:30
原創
1981 人瀏覽過

php抓包有什么好的工具提取抓取的页面信息??

回复内容:

php抓包有什么好的工具提取抓取的页面信息??

http://simplehtmldom.sourceforge.net/manual.htm

<code><?php require dirname(__FILE__).'/simple_html_dom.php';
$html = file_get_html('http://php.net/');
$news = array();
foreach($html->find('article.newsentry') as $article) {
    $item['time']    = trim($article->find('time',            0)->plaintext);
    $item['title']   = trim($article->find('h2.newstitle',    0)->plaintext);
    $item['content'] = trim($article->find('div.newscontent', 0)->plaintext);
    $news[] = $item;
}
print_r($news);</code>
登入後複製

file_get_html耗时只比wget和curl多一点.
simple_html_dom.php进行DOM分析速度也不慢,使用PHP7(PCRE JIT)速度还能成倍提升.
另外还有:
phpQuery - jQuery port to PHP
https://github.com/TobiaszCudnik/phpquery
http://querylist.cc/

Ganon - Fast (HTML DOM) parser written in PHP
https://github.com/Shemahmforash/Ganon

PHP抓包?没懂...
推荐个抓包的Fiddler

浏览器本身自带,如果想抓机器流量找。死耐fao。 音译,名字忘记了,或者百度搜索 科来

你是要采集?截取?还是存储数据流

根据你问题下的评论:

之前表达有误,我想问的是php抓取页面后,有什么好的方式解析dom提取数据?

可以看下这个开源项目
https://github.com/sunra/php-simple-html-dom-parser

jQueryPHP snoopy

相關標籤:
php
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
怎麼學好php
來自於 1970-01-01 08:00:00
0
0
0
PHP擴充intl
來自於 1970-01-01 08:00:00
0
0
0
php數據獲取?
來自於 1970-01-01 08:00:00
0
0
0
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板