文章详情页
python - 一个循环中对一个url进行post请求时,为什么只有一次爬取结果?
浏览:49日期:2022-09-11 16:17:20
问题描述
爬取代码如下:
# 一个循环中对一个url进行post请求时 只有一次爬取结果? for page in range(1, int(page_count) + 1):print ’page:’, pageself.crawl(self.comment_url, method = ’POST’, data = {’type’: ’all’, ’currentPage’: page, ’totalCount’: product_detail_dict[’comment_count’], ’placeId’: ’’, ’productId’: product_detail_dict[’product_id’], ’placeIdType’: ’’, ’isPicture’: ’’, ’isBest’: ’’, ’isPOI’: ’Y’, ’isELong’: ’N’}, callback = self.comment_page, save = {’uuid’: product_detail_dict[’uuid’]})
debug结果如下
循环做了3次,为什么只有一次爬取结果,是因为crawl同一个url吗?
问题解答
回答1:url 相同
排行榜
