public function index() { $url = 'http://sb.uedwin.com/zh-cn/OddsService/GetOdds?_=1455613746215&sportId=1&programmeId=0&pageType=1&uiBetType=am&displayView=2&oddsType=2&sortBy=1&isFirstLoad=true&MoreBetEvent=null'; /*$UrlManager = new UrlManagerController(); $html = $UrlManager->getPage($url); echo($html);*/ $data = QueryList::run('Request', ['target' => $url, 'method' => 'GET', 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0', 'timeout' => '30'])->getHtml($rel = false); $data = json_decode($data, true); dump($data); }
public function getUrls2() { //HTTP操作扩展 $urls = QueryList::run('Request', ['target' => $this->url, 'method' => 'GET', 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0', 'timeout' => '30'])->setQuery($this->param['rules'])->getData(); return $urls; }