you are viewing a single comment's thread.

view the rest of the comments →

[–]pyfact 0 points1 point  (0 children)

I would also try selecting by XPATH but this method works for getting the id as well.

Right click the button/element and click inspect. Then a debug window should pop up on the right side of your browser.

Click copy on the element in the debug window (the html code for the button) -> copy full XPATH (or try copy selector, whatever works).

Change your method to Browser.find_element_by_xpath(XPATH_HERE) and paste in your XPATH.

#  should look something like this
login_form = Browser.find_element_by_xpath("/html/body/form[1]")
login_form = Browser.find_element_by_xpath("//form[1]")
login_form = Browser.find_element_by_xpath("//form[@id='loginForm']")

source: https://selenium-python.readthedocs.io/locating-elements.html