()
| 33 | |
| 34 | |
| 35 | def 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 | |
| 51 | def download_Pic(title, image_list): |
no test coverage detected