こするためにソースコードを解析するbeautfiulsoup使用:Pythonの正規表現文字列の除外
tempSite = preSite+'/contact_us/'
print tempSite
theTempSite = urlopen(tempSite).read()
currentTempSite = BeautifulSoup(theTempSite)
lightwaveEmail = currentTempSite('input')[7]
#<input type="Hidden" name="bb_recipient" value="[email protected]" />
のみ
[email protected]が印刷されるように
どのように私はlightwaveEmailをre.compileことができますか?
タグ付けと帰属のようなものは、しかし、私はまだかなり私が探しているの出力が届かない、途方もなく助けたいですname = "bb_recipient" value = "[email protected]" />] - 値フィールドを明示的に唯一の出力としてスプライスする必要があります。 – Hikalea
Urp .. check update .. – synthesizerpatel
'.findAll()'はリストを返します。 'soup.find( 'input'、dict(name =" bb_recipient "、value = True))'を使って最初に見つかった要素を取得します。 – jfs