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

Function get_page_urls

meizitu.py:35–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34
35def get_page_urls():
36
37 for i in range(1, 2):
38 baseurl = 'https://www.mzitu.com/page/{}'.format(i)
39 html = request_page(baseurl)
40 soup = BeautifulSoup(html, 'lxml')
41 elements = soup.find(class_='postlist').find_all('li')
42 urls = []
43 for item in elements:
44 url = item.find('span').find('a').get('href')
45 print('页面链接:%s' % url)
46 urls.append(url)
47
48 return urls
49
50
51def download_Pic(title, image_list):

Callers 1

meizitu.pyFile · 0.85

Calls 1

request_pageFunction · 0.85

Tested by

no test coverage detected