thinkphp5 QueryList4 PhantomJs 网页爬虫报错怎么解决?

代码:

<?php
namespace app\admin\Controller;
use think\Controller;
use app\admin\controller\Check;
use think\Db;
use think\Request;
use QL\QueryList;
use QL\Ext\PhantomJs;
class Grab extends Check {
    
    public function index()
    {
        
        $path = DS. 'public' . DS . 'static' . DS . 'phantomjs';
        $ql = QueryList::getInstance();
        $ql->use(PhantomJs::class,$path);       
        $html = $ql->browser('http://www.ooopic.com/')->getHtml();
        print_r($html);
        
    }


}



报错:

Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file)
阅读 5k
2 个回答
\JonnyW\PhantomJs\DependencyInjection\ServiceContainer

public function load($file = null) {}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题