Selenium interacts with a web browser in the same way as a user. Therefore, if there is an html element that you are trying to interact with, this is not visible, so the simplest explanation is that when you write your selenium code, you are not interacting with the web page, as usual.
, html - DOM . firebug html, , . DOM- html- . , , , , .
, , , - , javascript , , .
:
import time
time.sleep(1)
:
import time
welcome_button = browser.find_element_by_class_name('welcomeLoginButton')
wait_for_element_visibility(welcome_button).click()
def wait_for_element_visibility(element):
if element.is_visible():
return element
else:
for i in range(10):
if not element.is_visible():
time.sleep(.5)
else:
return element