Update meizitu.py

大家好,我是新手,请多多指教,谢谢!
pull/47/head
mjy0424 2020-07-28 12:39:45 +08:00 committed by GitHub
parent a3200cc319
commit 6f645ff220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -13,9 +13,7 @@ def download_page(url):
return r.text
def get_pic_list(html):
'''
获取每个页面的套图列表,之后循环调用get_pic函数获取图片
'''
#获取每个页面的套图列表,之后循环调用get_pic函数获取图片
soup = BeautifulSoup(html, 'html.parser')
pic_list = soup.find_all('li', class_='wp-item')
for i in pic_list:
@ -24,11 +22,8 @@ def get_pic_list(html):
text = a_tag.get_text()
get_pic(link, text)
def get_pic(link, text):
'''
获取当前页面的图片,并保存
'''
#获取当前页面的图片,并保存
html = download_page(link) # 下载界面
soup = BeautifulSoup(html, 'html.parser')
pic_list = soup.find('div', id="picture").find_all('img') # 找到界面所有图片