QueryList-PhantomJS
QueryList-PhantomJS copied to clipboard
获取不到html
$html = $ql->browser('https://m.toutiao.com')->getHtml(); 返回"" 请问大神们什么原因呢?
我也获取的空body(TP5.1+PHP7.2.9)
配合QueryList使用有个bug:PHP Warning: Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() ...,需要修改源代码函数为 load($file = null) PHP7.3以上报错一个函数不再支持,所以切到7.2.9
win10下 二进制文件路径只能这样设置,其他报错,跟演示不一样
$ql = QueryList::use(PhantomJs::class,'D:/Program Files/phantomjs-2.1.1/bin/phantomjs.exe'); $html = $ql->browser('https://www.baidu.com')->getHtml(); print_r($html);
获取结果为没有BODY的