1

with selenium, i'm trying to click an element but not working with this element, the page is here page (username/password :admin/admin)

enter image description here

wait2 = WebDriverWait(driver, 10)
element = wait2.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="operate2a5a0448a8bf44a8898ec13e95b152fc"]/div/div[2]')))
element.click()

i tried this on other element in the same page and got no problem

no idea why not working on this element

2 Answers 2

1

operate2a5a0448a8bf44a8898ec13e95b152fc seems to be dynamically created id.
The simplest way to access this element is with text based XPath locator:

wait2.until(EC.element_to_be_clickable((By.XPATH, "//div[contains(text(),'Entry Registration')]"))).click()
Sign up to request clarification or add additional context in comments.

Comments

1

you can try with below code as well :

//img[contains(@src,'registration')]/..

in code :

wait2 = WebDriverWait(driver, 10)
element = wait2.until(EC.element_to_be_clickable((By.XPATH, "//img[contains(@src,'registration')]/..")))
element.click()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.