Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active March 1, 2016 10:53
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/c1ec5ba78ecaed48f99c to your computer and use it in GitHub Desktop.
Save kurozumi/c1ec5ba78ecaed48f99c to your computer and use it in GitHub Desktop.
【Python・SeleniumのWait機能の使い方】任意のテキストがタイトルタグに含まれるまで待つ
# coding: utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.get("https://www.google.co.jp")
# タイトルタグに任意のテキストが含まれたタイトルが表示されるまで10秒待つ
WebDriverWait(driver, 10).until(
EC.title_contains("Google")
)
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment