This commit is contained in:
dylan 2023-07-28 12:41:53 +08:00
parent 12095565b5
commit 5dafc9bd81
2 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,8 @@ www的那个地址抓CK登录后F12点到network不要用命令document.co
2023/6/27 gpt错误跳出Cp0204的pr
2023/7/28 修复获取不到评价信息
## 运行例图(评价晒单基本是优质评价,评价有奖的订单可以获得奖励!!!):
![image](https://i.postimg.cc/KznsXxfN/1.png)

View File

@ -26,8 +26,8 @@ class JDSpider:
# 爬虫实现类传入商品类别如手机、电脑构造实例。然后调用getData搜集数据。
def __init__(self, categlory, ck):
# jD起始搜索页面
self.startUrl = "https://search.jd.com/Search?keyword=%s&enc=utf-8" % (
quote(categlory))
self.startUrl = "https://search.jd.com/Search?keyword=%s&enc=utf-8&wq=%s" % (
quote(categlory),quote(categlory))
self.commentBaseUrl = "https://sclub.jd.com/comment/productPageComments.action?"
self.headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',