MCPcopy
hub / github.com/wistbean/learn_python3_spider / download_Pic

Function download_Pic

meizitu.py:51–62  ·  view source on GitHub ↗
(title, image_list)

Source from the content-addressed store, hash-verified

49
50
51def download_Pic(title, image_list):
52 # 新建文件夹
53 os.mkdir(title)
54 j = 1
55 # 下载图片
56 for item in image_list:
57 filename = '%s/%s.jpg' % (title, str(j))
58 print('downloading....%s : NO.%s' % (title, str(j)))
59 with open(filename, 'wb') as f:
60 img = requests.get(item, headers=header(item)).content
61 f.write(img)
62 j += 1
63
64def download(url):
65 html = request_page(url)

Callers 1

downloadFunction · 0.85

Calls 1

headerFunction · 0.85

Tested by

no test coverage detected