【发布时间】:2015-03-30 05:28:03
【问题描述】:
我在BeautifulSoup 代码中调用了find_all()。这目前可以让我获得所有图像,但如果我只想定位在其src 中具有“占位符”子字符串的图像,我该怎么做?
for t in soup.find_all('img'): # WHERE img.href.contains("placeholder")
【问题讨论】:
-
大概您的意思是
src属性,而不是href属性?
标签: python html beautifulsoup html-parsing