Closed RipperTs closed 4 years ago
`/**
采集商品列表数据 */ protected function getList() { $rules = [ 'goods_name' => ['.info .product', 'text'], 'brand_name' => ['.info .brand strong', 'text'], 'goods_price_line_dollar' => ['.discount strong','text'], 'goods_price_dollar' => ['.discount strong','text'], ]; $html = $this->curl($this->listUrl()); $data = QueryList::html($html) ->rules($rules) ->query() ->getData() // 获取采集数据 ->all(); var_dump($data);
}`
值得说明的是 4.1.1 版本无此问题,4.2.0 版本开始就是这样了
是的,更新公告里有做说明,如果要采集列表的话请设置 range() 参数,或者将项目版本固定到 4.1.1 版本
`/**
采集商品列表数据 */ protected function getList() { $rules = [ 'goods_name' => ['.info .product', 'text'], 'brand_name' => ['.info .brand strong', 'text'], 'goods_price_line_dollar' => ['.discount strong','text'], 'goods_price_dollar' => ['.discount strong','text'], ]; $html = $this->curl($this->listUrl()); $data = QueryList::html($html) ->rules($rules) ->query() ->getData() // 获取采集数据 ->all(); var_dump($data);
}`