Issue
Hey guys im completely lost. I've tried everything find_by_xpath/by_class etc but it just won't work. I always get the can't find element error: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".ms-Button _3vq4lJQg9EQ9QnW_2iLCJo ms-Button--action ms-Button--command root-205"} (Session info: chrome=91.0.4472.77)
next_but=web.find_element_by_id('idSIButton9')
time.sleep(1)
next_but.click()
pwin=web.find_element_by_id("i0118")
pwin.send_keys(PW)
time.sleep(2)
next_but2=web.find_element_by_id("idSIButton9")
next_but2.click()
web.get(link)
rules=web.find_element_by_class_name('ms-Button _3vq4lJQg9EQ9QnW_2iLCJo ms-Button--action ms-Button--command root-205')
I've also tried that the WebDriver waits for the element to load and it seems that the element isn't in another frame.Thats the button I'd like to be pressed
Please help me im completely lost thanks in advance
Solution
I believe this should be resolve with WebDriverWait
:
Code to try it out :
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//span[text()='Regeln']/ancestor::button"))).click()
Answered By - cruisepandey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.