2015-11-30 18:22

引用来自“红薯”的评论

绝对 java 神器
红薯也在用这个? 哈哈 很赞的jar
2015-08-05 21:35
@北京冰帆科技 效率低,你别骗我,我在foreach前后加了$start = microtime(true);和echo microtime(true)-$start."\n";测试DOM操作耗时,获取php.net首页新闻,耗时0.0013秒,这效率叫做低?另我测试了file_get_html获取文件的时间,耗时跟命令行的curl和wget几乎一样:
time curl -o php.html http://php.net/
time wget -O php.html http://php.net/
time php -r "require 'simple_html_dom.php';file_get_html('http://php.net/');"
2015-08-05 13:08

引用来自“红薯”的评论

绝对 java 神器
有空用jsoup来抓osc,2333333
2015-08-03 15:53
PHP DOM操作库simple-html-dom.php,快速获取HTML结构的内容.
<?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);
这样,PHP首页的新闻就被抓下来了,屌不屌?
2015-08-03 10:41

引用来自“红薯”的评论

绝对 java 神器

引用来自“penngo”的评论

红薯就是靠此神器收集全球种子。
莫非,之前git被攻击就是为夺这个宝???
2015-08-03 09:24

引用来自“红薯”的评论

绝对 java 神器
红薯就是靠此神器收集全球种子。
2015-08-03 08:56
此乃神器也!
2015-08-03 08:24

引用来自“红薯”的评论

绝对 java 神器
是滴》。。。《
2015-08-03 07:58
绝对 java 神器
回复 @
{{emojiItem.symbol}}
返回顶部
顶部