Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created February 17, 2016 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/e4ff969350db5f116c8e to your computer and use it in GitHub Desktop.
Save kurozumi/e4ff969350db5f116c8e to your computer and use it in GitHub Desktop.
【Python】Seleniumで要素が見つかるまで10秒待つ設定(タイムアウト設定)する方法
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