- Go to ThinkPHP official website to download the latest ThinkPHP5 framework code: http://www.thinkphp.cn
- Execute the composer command in the ThinkPHP5 code root directory to install QueryList:
composer require jaeger/querylist
- The following Demonstrates the use of QueryList in the
- Index controller:
<?php namespace app\index\controller; use QL\QueryList; class Index { public function index() { //采集某页面所有的图片 $data = QueryList::get('http://cms.querylist.cc/bizhi/453.html')->find('img')->attrs('src'); //打印结果 print_r($data->all()); } }
That’s it. Note
- QueryList4 cannot be installed and used in environments below PHP7!
- QueryList4 cannot be installed and used in environments below PHP7! QueryList4 cannot be installed and used in environments below PHP7!
If you still don’t know how to install it, you can go to the QueryList exchange group (123266961) to download the complete ThinkPHP5 integrated QueryList4 compressed package.