diff --git a/README-ZH.md b/README-ZH.md index f237007..62d566a 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -131,7 +131,7 @@ QueryList::get('https://top.etao.com')->encoding('UTF-8','GB2312')->find('a')->t QueryList::get('https://top.etao.com')->encoding('UTF-8')->find('a')->texts(); ``` -#### HTTP网络操作 +#### HTTP网络操作(GuzzleHttp) - 携带cookie登录新浪微博 ```php //采集新浪微博需要登录才能访问的页面 @@ -217,6 +217,7 @@ $ql = QueryList::getInstance(); //绑定一个myHttp方法到QueryList对象 $ql->bind('myHttp',function ($url){ + // $this 为当前的QueryList对象 $html = file_get_contents($url); $this->setHtml($html); return $this; diff --git a/README.md b/README.md index 4e05d0c..4079a46 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ QueryList::get('https://top.etao.com')->encoding('UTF-8','GB2312')->find('a')->t QueryList::get('https://top.etao.com')->encoding('UTF-8')->find('a')->texts(); ``` -#### HTTP Client +#### HTTP Client (GuzzleHttp) - Carry cookie login GitHub ```php //Crawl GitHub content @@ -216,6 +216,7 @@ $ql = QueryList::getInstance(); //Bind a `myHttp` method to the QueryList object $ql->bind('myHttp',function ($url){ + // $this is the current QueryList object $html = file_get_contents($url); $this->setHtml($html); return $this;