图片提取代码错误,需要把图片批量提取并保存,该如何改写?
>>> import requests
>>> from bs4 import BeautifulSoup
>>> from PIL import Image
>>> r=requests.get("https://www.bilibili.com/read/cv16332851?from=search&spm_id_from=333.337.0.0")
>>> soup=BeautifulSoup(r.text)
>>> a=soup.find_all('img')
>>> soup.find_all('img')
>>> import re
>>> soup.find_all('img',{'src':re.compile('jpg')})