jae-jae / QueryList

:spider: The progressive PHP crawler framework! 优雅的渐进式PHP采集框架。
https://querylist.cc
2.66k stars 441 forks source link

可以加载html 但是find找不到内容 #146

Closed AdolphYu closed 5 months ago

AdolphYu commented 3 years ago

content.txt

$q = QueryList::html($content); $a = $q->find('h1 span')->text();

输出为空字符串

jae-jae commented 2 years ago

可能是QueryList解析内容失败,可以通过 getHtml() 方法测试,打印 QueryList 解析的内容:

$ql = QueryList::html($html);
$html = $ql->getHtml(true);
echo $html;

相关文档:https://querylist.cc/docs/api/v4/getHtml