<?php
require_once("phpQuery.php");
//引入phpQuery文件
phpQuery::newDocumentFile('https://www.yc717.com/category-ganhuofenx.html');
//需要采集的页面
foreach(pq('a') as $key=>$value) {
echo $value->getAttribute('href').'<br/>';
}
//采集到的是一个对象,所以循环打印,输出所有的超链接
采集页面所有超链接成功