鍍金池/ 問(wèn)答/數(shù)據(jù)分析&挖掘  PHP  網(wǎng)絡(luò)安全  HTML/ thinkphp5 QueryList4 PhantomJs 網(wǎng)頁(yè)爬蟲報(bào)錯(cuò)怎么解

thinkphp5 QueryList4 PhantomJs 網(wǎng)頁(yè)爬蟲報(bào)錯(cuò)怎么解決?

代碼:

<?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);
        
    }


}



報(bào)錯(cuò):

Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file)
回答
編輯回答
撥弦

樓上正解,QueryList文檔也有說(shuō)明:http://doc.querylist.cc/site/...

2017年6月11日 12:06
編輯回答
墨染殤
\JonnyW\PhantomJs\DependencyInjection\ServiceContainer

public function load($file = null) {}
2017年10月4日 21:51