Created
February 17, 2016 00:22
-
-
Save kurozumi/e4ff969350db5f116c8e to your computer and use it in GitHub Desktop.
【Python】Seleniumで要素が見つかるまで10秒待つ設定(タイムアウト設定)する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
# Firefox起動 | |
driver = webdriver.Firefox() | |
# 要素が見つかるまで10秒待つ設定 | |
driver.implicitly_wait(10) # seconds | |
# ページ取得 | |
driver.get("http://www.yahoo.co.jp/") | |
# ページタイトル取得 | |
title = driver.title | |
# Firefox終了 | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment