Skip to content

Commit e686ebe

Browse files
committed
fix: 修复生成函数参数类型注解并更新请求头中的cookie字段
1 parent 637e7a9 commit e686ebe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

auto_comment_plus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def upload_image(filename, file_path, session, headers):
145145

146146

147147
# 评价生成
148-
def generation(pname, _class: int = 0, _type: int = 1, opts: object = None):
148+
def generation(pname:str, _class: int = 0, _type: int = 1, opts: object = None):
149149
result = []
150150
opts = opts or {}
151151
items = ["商品名"]

jdspider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, categlory):
6868
**BASE_HEADERS,
6969
"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.7",
7070
"accept-language": "en,zh-CN;q=0.9,zh;q=0.8",
71-
"cookie": cookie,
71+
"Cookie": cookie,
7272
"priority": "u=0, i",
7373
"sec-ch-ua": '"Microsoft Edge";v="129", "Not=A?Brand";v="8", "Chromium";v="129"',
7474
"sec-ch-ua-mobile": "?0",
@@ -144,7 +144,7 @@ def getId(self) -> list:
144144
return []
145145

146146
html = etree.HTML(response.text)
147-
return html.xpath('//li[@class="gl-item"]/@data-sku')
147+
return html.xpath('//li[@class="gl-item"]/@data-spu')
148148

149149
def getData(self, maxPage: int, score: int):
150150
"""

0 commit comments

Comments
 (0)