webスレイピングの一環で、formタグの属性(action)を取得したい次第です。
formタグ自体は、find_allにて取得しました。
その結果から、actionの値を取得したいです。
最終的には、そのactionの値に http://example を付加して、session.get に使いたい次第です。
####### Webソース(抜粋)
<form action="/corp/login/login/" method="post" class="mailForm">…</form>####### コーディング
soup = BeautifulSoup(res.text,'lxml')
links = soup.find_all('form',class_='mailForm')
x = links.get('action')
print(x)
url_update = 'http://example.jp' + x.string
print(url_update)
res = session.get(url_update)
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/10 00:50