Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
injetlee committed Jul 28, 2018
1 parent 4fb9c36 commit 6ce2cc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 爬虫集合/meizitu.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_pic(link, text):
for i in pic_list:
pic_link = i.get('src') # 拿到图片的具体 url
r = requests.get(pic_link, headers=headers) # 下载图片,之后保存到文件
with open('pic/{}/{}'.format(text, link.split('/')[-1]), 'wb') as f:
with open('pic/{}/{}'.format(text, pic_link.split('/')[-1]), 'wb') as f:
f.write(r.content)
time.sleep(1) # 休息一下,不要给网站太大压力,避免被封

Expand Down

0 comments on commit 6ce2cc8

Please sign in to comment.