3
私は、HTMLの以下のスープから(一つだけ<strong>Website:</strong>
がページにあります)のhrefを抽出することができるように見えることはできません。美しいスープは、hrefの取得方法を
<div id='id_Website'>
<strong>Website:</strong>
<a href='http://google.com' target='_blank' rel='nofollow'>www.google.com</a>
</div></div><div>
これは何をであるI思想は、この場合に
href = soup.find("strong" ,text=re.compile(r'Website')).next["href"]
これは私が欲しいものです。ありがとうございました。 IDで検索して次のhref値を取得するにはどうすればよいですか? – howtodothis
あなたは 'soup.findAll( 'div'、id = re.compile( 'Website $'))'のようなものを使って、 'div'sすべてを考慮することができます - 他の例を見ることなく、しかし、それらを選ぶ。 –