Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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