Introduced into the project


If installed through Composer, you only need to introduce the vendor/autoload.php

file to use QueryList and all its plug-ins ( if a plug-in is installed).

Example:

<?php
require 'vendor/autoload.php';
use QL\QueryList;
$hj = QueryList::Query('http://mobile.csdn.net/',array("url"=>array('.unit h1 a','href')));
$data = $hj->getData(function($x){
    return $x['url'];
});
print_r($data);

Manual installation

Manual download
These two files are phpQuery.php

and

QueryList.php, and then you can manually introduce these two files. Example:

<?php
require 'phpQuery.php';
require 'QueryList.php';
use QL\QueryList;
$hj = QueryList::Query('http://mobile.csdn.net/',array("url"=>array('.unit h1 a','href')));
$data = $hj->getData(function($x){
    return $x['url'];
});
print_r($data);

Manually install the QueryList plug-in


Assume the directory where QueryList is located If it is:

    path/to/QueryList/

  • , then the plug-in directory should be:
  • path/to/QueryList/Ext/

  • The class library storage directory that the plug-in depends on is:
  • path/to/QueryList/Ext/Lib/

  • If the directories do not exist, you can create these directories manually. Then you need to manually introduce the plug-in files you need to use, and then you can use the plug-in.

Use QueryList in major frameworksFollow the rules for importing class libraries of the currently used framework and you can use it. There will be a special explanation later.


#