I am trying to find the element for a button in the webpage but cant seem to locate it. Usually I would use .find_element_by_css_selector
and find the code. But now since they only gave the class, I tried another method which was to search up the hierarchy. Hence I used browser.find_element_by_css_selector('div[]')
and I managed to locate the button group. But i cant seem to move down the hierarchy to the button.
Image when inspecting the elements
By the way, the website is https://form.gov.sg/#!/signin
CodePudding user response:
If you are looking for Get Started button to click and have this CSS selector div[]
You can move down like this :
div[class="btn-grp"] button
In Selenium :
browser.find_element_by_css_selector("div[hljs-string">"] button")