Issue
I'm looking for Unique Xpath for this element (Select) in google language settings https://myaccount.google.com/language?hl=en already have this xpath but I need something more accurate and unique
WebDriverWait(driver, 30).until(
EC.element_to_be_clickable((By.XPATH,
"//*[@id='yDmH0d']/div[11]/div/div[2]/div[3]/div[2]/button"))).click()
Solution
If you pay attention to the HTMLDOM :
You can construct a xpath
based on attribute name only. You do not need their values
nor their text
.
//div[@data-is-touch-wrapper]/button[@data-id and @aria-label]
represent two matching nodes.
(//div[@data-is-touch-wrapper]/button[@data-id and @aria-label])[2]
should get the job done.
Answered By - cruisepandey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.