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

Function download

meizitu.py:64–77  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

62 j += 1
63
64def download(url):
65 html = request_page(url)
66 soup = BeautifulSoup(html, 'lxml')
67 total = soup.find(class_='pagenavi').find_all('a')[-2].find('span').string
68 title = soup.find('h2').string
69 image_list = []
70
71 for i in range(int(total)):
72 html = request_page(url + '/%s' % (i + 1))
73 soup = BeautifulSoup(html, 'lxml')
74 img_url = soup.find('img').get('src')
75 image_list.append(img_url)
76
77 download_Pic(title, image_list)
78
79
80def download_all_images(list_page_urls):

Callers

nothing calls this directly

Calls 2

request_pageFunction · 0.85
download_PicFunction · 0.85

Tested by

no test coverage detected