phpquery抓取网页内容,以下都经过测试,不过phpquery你最好用我上传的,别的不保证,其实我也是下载的。
include ‘phpQuery/phpQuery.php‘;
/**
phpQuery::newDocumentFile("http://www.helloweba.com/blog.html");
$artlist = pq(".blog_li");
foreach($artlist as $li){
echo pq($li)->find(‘h2‘)->html()." ";
}
**/
phpQuery::newDocumentFile("http://mp.weixin.qq.com/s?__biz=MzA5NTQ3ODUwNw==&mid=402456679&idx=1&sn=ef666e16a81b5b474c076329c3ce211c&3rd=MzA3MDU4NTYzMw==&scene=6#rd");
echo "标题:".pq(‘#img-content‘)->find(‘#activity-name‘)->text()."<br>";
echo "时间:".pq(‘.rich_media_meta_list‘)->find(‘#post-date‘)->text()."<br>";
echo "内容:".pq(‘#js_content‘)->html();
/**
phpQuery::newDocumentFile(‘http://job.blueidea.com‘);
$companies = pq(‘#hotcoms .coms‘)->find(‘div‘);
foreach($companies as $company){
echo pq($company)->find(‘h3 a‘)->text()."<br>";
}**/