我正在尝试从Wikipedia页面提取所有图像:
from bs4 import BeautifulSoup
from urllib.request import urlopen
webpage = urlopen('https://en.wikipedia.org/wiki/List_of_largest_banks')
bs = BeautifulSoup(webpage,'html.parser')
print(bs)
aList= bs.find_all('a',{'class':'image'})
for a in aList:
if(a['href']=="*ICBC*"):
print(a['href'])
请提供代码帮助您 1打印工行银行图像的所有href 2直接将图像获取到Word文档中