Board logo

标题: [问题求助] Python如何用beautifulsoup获取图片地址 [打印本页]

作者: netdzb    时间: 2021-2-24 18:14     标题: Python如何用beautifulsoup获取图片地址

<div>
<img class="alignnone" src="https://网址/wp-content/uploads/2020/01/2-8.jpg" alt="" width="700" height="1050" />
......
</div>

是不是这样写啊?

addr = soup.find('div',attrs={'class':'src'})
print(src.text)




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2