Selenium code to wait until CSS class is available and extract text in Python -


i have looked @ questions on here related none of them concerned finding class , extracting text part of class.

my goal automate process of entry website finds emails, given name , domain names. far have code automate entry of name , domain, , click on "search", issue waiting result load. want code wot wait until css class "one" present , extract text related class, e.g. following snippet:

<h3 class="one">success</h3> 

extract text "success".

you need explicitly wait element become visible:

from selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec  wait = webdriverwait(driver, 10) h3 = wait.until(ec.visibility_of_element_located((by.css_selector, "h3.one"))) print h3.text 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -