Answer the question
In order to leave comments, you need to log in
How to parse an element only if it is visible?
Hello. I am using python and selenium. I have a site. And I need to parse an element only if that element is visible
Answer the question
In order to leave comments, you need to log in
Stupidly the first answer on the stack
browser.find_element_by_css_selector(".reply-button").click()
# Wait for initialize, in seconds
wait = WebDriverWait(browser, 10)
email = wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.anonemail'))).get_attribute("value")
print(email)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question