start V4
This commit is contained in:
15
src/Dom.php
Normal file
15
src/Dom.php
Normal 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
54
src/QueryList.php
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user