bs下载图片+进度条
刚开始学习爬虫,当然是从简单地开始,没有什么比爬点美女图片更能提起兴趣的了,这次要爬的网站是彼岸网,不废话,上代码
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
# 通过url解析获得网页内容
def parse_html(url):
header = {
'User - Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/'
'94.0.4606.81 Safari/537.36'
}
res = requests.get(url, hea