jae-jae / QueryList

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

更新了composer就一直报这个错,写法跟文档一样 #109

Closed smiaoO712 closed 4 years ago

smiaoO712 commented 4 years ago

Error 500: Internal Server Error { "message": "Argument 1 passed to QL\Dom\Query::handleData() must be an instance of Tightenco\Collect\Support\Collection, instance of Illuminate\Support\Collection given, called in /home/vagrant/code/yishang/vendor/jaeger/querylist/src/Dom/Query.php on line 142", "status_code": 500 }

代码 $url = 'https://it.ithome.com/ityejie/'; // 元数据采集规则 $rules = [ // 采集文章标题 'title' => ['h2>a','text'], // 采集链接 'link' => ['h2>a','href'], // 采集缩略图 'img' => ['.list_thumbnail>img','src'], // 采集文档简介 'desc' => ['.memo','text'] ]; // 切片选择器 $range = '.content li'; $rt = QueryList::get($url)->rules($rules)->range($range)->query()->getData(); print_r($rt->all());die();

jae-jae commented 4 years ago

是在laravel框架中使用QueryList吗?

smiaoO712 commented 4 years ago

是的

------------------ 原始邮件 ------------------ 发件人: "Jaeger(黄杰)"<notifications@github.com>; 发送时间: 2020年4月3日(星期五) 下午5:00 收件人: "jae-jae/QueryList"<QueryList@noreply.github.com>; 抄送: "徐永胜"<964392197@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [jae-jae/QueryList] 更新了composer就一直报这个错,写法跟文档一样 (#109)

是在laravel框架中使用QueryList吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jae-jae commented 4 years ago

看来是类库冲突了,我尽快修复一下

smiaoO712 commented 4 years ago

好的,谢谢大佬

------------------ 原始邮件 ------------------ 发件人: "Jaeger(黄杰)"<notifications@github.com>; 发送时间: 2020年4月3日(星期五) 下午5:04 收件人: "jae-jae/QueryList"<QueryList@noreply.github.com>; 抄送: "徐永胜"<964392197@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [jae-jae/QueryList] 更新了composer就一直报这个错,写法跟文档一样 (#109)

看来是类库冲突了,我尽快修复一下

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jae-jae commented 4 years ago

已修复,更新到V4.2.4版本即可

anhao commented 4 years ago

更新到 4.2.4 版本吗.. 今天也发现这个错误了, 我说用着好好的,更新下就没用了