python3 beautifulsoup查找网页中的链接

来源:互联网 发布:mac os 10.12原版安装 编辑:程序博客网 时间:2024/05/22 17:32
from bs4 import BeautifulSoupsoup=BeautifulSoup(html, "html.parser")    a=soup.find_all('img',attrs={'pic_type':'0','class':'BDE_Image'})    for x in a:        print(x['src'])

soup.find_all()返回bs4.element.ResultSet,然后逐个读取

0 0
原创粉丝点击