Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryList v3版 有时候采集不全 #11

Open
huige728 opened this issue Aug 11, 2021 · 0 comments
Open

QueryList v3版 有时候采集不全 #11

huige728 opened this issue Aug 11, 2021 · 0 comments

Comments

@huige728
Copy link

`
$webUrl = 'https://www.mm131.net/';
require 'inc/phpQuery.php';
require 'inc/QueryList.php';
use QL\QueryList;

//拼装列表页(内含菜单名、菜单ID、页码):https://www.mm131.net/xinggan/list_6_7.html
function listUrl($catName,$catId,$page=1){
global $webUrl;
$url = $webUrl.$catName.'/';
if($page > 1){
$url = $url . 'list_'.$catId.'_'.$page.'.html';
}
return $url;
}

function getArtUrl($url){

$rules = ['link' => ['a:eq(0)','href']];
$range = '.list-left dd:not(:last)';
$data = QueryList::Query($url,$rules,$range)->data;

echo '采集到本页数据量为:'.count($data);

}
`
列表页一页有20条数据,有时候只能采集到12-14条,有时候有是20条,全看运气,也不见报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant