利用爬虫爬取wallhaven壁纸
'''解析网页'''
headers={
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36 Edg/87.0.664.41'}
response=requests.get('https://wallhaven.cc/toplist',headers=headers)
html=response.text
# print(html)
'''解析图片'''
urls=re.findall('<img alt=".*?" class=".*?" data-src="(.*?)" src="" >',html