Last active
March 1, 2016 10:53
-
-
Save kurozumi/c1ec5ba78ecaed48f99c to your computer and use it in GitHub Desktop.
【Python・SeleniumのWait機能の使い方】任意のテキストがタイトルタグに含まれるまで待つ
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
# 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