【发布时间】:2011-11-15 08:07:42
【问题描述】:
我似乎无法从以下html汤中提取href(页面上只有一个<strong>Website:</strong>):
<div id='id_Website'>
<strong>Website:</strong>
<a href='http://google.com' target='_blank' rel='nofollow'>www.google.com</a>
</div></div><div>
这是我认为应该起作用的
href = soup.find("strong" ,text=re.compile(r'Website')).next["href"]
【问题讨论】:
标签: beautifulsoup