php抓包有什么好的工具提取抓取的页面信息??
大家讲道理
大家讲道理 2017-04-10 16:10:44
[PHP讨论组]

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

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回复(6)
黄舟

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

<?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('p.newscontent', 0)->plaintext);
    $news[] = $item;
}
print_r($news);

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

PHP中文网

jQueryPHP snoopy

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号