2.0版本,调整框架,不再兼容以前版本
This commit is contained in:
@@ -48,7 +48,7 @@ require '../QueryList.class.php';
|
||||
$reg_znum='/([\d,]+) result(s)?/';
|
||||
$getHtmlWay = 'curl';
|
||||
}
|
||||
$searcherObj = new QueryList($url,$this->regArr,$this->regRange,$getHtmlWay,false);
|
||||
$searcherObj = QueryList::Query($url,$this->regArr,$this->regRange,$getHtmlWay,false);
|
||||
for($i=0;$i<count($searcherObj->jsonArr);$i++)
|
||||
{
|
||||
if($this->searcher=='baidu')
|
||||
|
||||
@@ -6,7 +6,7 @@ $url = "http://www.oschina.net/code/list";
|
||||
$reg = array("title"=>array(".code_title a:eq(0)","text"),"url"=>array(".code_title a:eq(0)","href"),"author"=>array("img","title"));
|
||||
$rang = ".code_list li";
|
||||
//使用curl抓取源码并以GB2312编码格式输出
|
||||
$hj = new QueryList($url,$reg,$rang,'curl','GB2312');
|
||||
$hj = QueryList::Query($url,$reg,$rang,'curl','GB2312');
|
||||
$arr = $hj->jsonArr;
|
||||
echo "<pre>";
|
||||
print_r($arr);
|
||||
@@ -21,7 +21,7 @@ echo $json . "<hr/>";
|
||||
//采OSC内容页内容
|
||||
$url = "http://www.oschina.net/code/snippet_186288_23816";
|
||||
$reg = array("title"=>array(".QTitle h1","text"),"con"=>array(".Content","html"));
|
||||
$hj = new QueryList($url,$reg);
|
||||
$hj = QueryList::Query($url,$reg);
|
||||
$arr = $hj->jsonArr;
|
||||
echo "<pre>";
|
||||
print_r($arr);
|
||||
|
||||
BIN
demo/thanks.png
Normal file
BIN
demo/thanks.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Reference in New Issue
Block a user