Posted in PHP onMay 17, 2017
本文实例讲述了PHP正则+Snoopy抓取框架实现的抓取淘宝店信誉功能。分享给大家供大家参考,具体如下:
<?php header("Content-Type:text/html;charset=gbk"); include "Snoopy.class.php"; $snoopy = new Snoopy; $snoopy->fetch("http://rate.taobao.com/user-rate-f01d9cb1245a22fcea470c11665de90e.htm?spm=0.0.0.37.TOtKhZ"); $html=$snoopy->results; //echo $html; //var_dump($html); preg_match('/<ul class=\"sep\">\s*<li>[\w\W]*align=\"absmiddle\" class=\"rank\" \/><\/a><\/li>/',$html,$result); //preg_match_all('/<div\sid=\"([a-z0-9_]+)\">([^<>]+)<\/div>/',$html,$result); var_dump($result); echo "<br>";
PHP正则+Snoopy抓取框架实现的抓取淘宝店信誉功能实例
- Author -
zhoushengbin3声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@