We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fb9c36 commit 6ce2cc8Copy full SHA for 6ce2cc8
爬虫集合/meizitu.py
@@ -40,7 +40,7 @@ def get_pic(link, text):
40
for i in pic_list:
41
pic_link = i.get('src') # 拿到图片的具体 url
42
r = requests.get(pic_link, headers=headers) # 下载图片,之后保存到文件
43
- with open('pic/{}/{}'.format(text, link.split('/')[-1]), 'wb') as f:
+ with open('pic/{}/{}'.format(text, pic_link.split('/')[-1]), 'wb') as f:
44
f.write(r.content)
45
time.sleep(1) # 休息一下,不要给网站太大压力,避免被封
46
0 commit comments