This commit is contained in:
Jaeger
2017-09-19 02:33:38 +08:00
parent 1a7864dcf8
commit e3576ce407
4 changed files with 71 additions and 474 deletions

15
src/Dom.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
/**
* Created by PhpStorm.
* User: iamhj
* Date: 2017/9/19
* Time: 2:00
*/
namespace QL;
class Dom
{
}

54
src/QueryList.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace QL;
use phpQuery;
/**
* QueryList
*
* 一个基于phpQuery的通用列表采集类
*
* @author Jaeger
* @email JaegerCode@gmail.com
* @link https://github.com/jae-jae/QueryList
* @version 4.0.0
*
*/
class QueryList
{
private $html;
private $document;
/**
* QueryList constructor.
*/
public function __construct()
{
}
/**
* @return mixed
*/
public function getHtml()
{
return $this->html;
}
/**
* @param mixed $html
*/
public function setHtml($html)
{
$this->html = $html;
$this->document = phpQuery::newDocumentHTML($this->html);
return $this;
}
public function find($selector)
{
return pq($this->document)->find($selector);
}
}