1

I've been trying to access this element I have tried XPATH, CSSSELECTOR and none worked. I'm trying to acces sitekey= and pass it into a variable.

I'm expecting the function to return the sitekey to a variable.

Heres is my code:

driver.find_element(By.XPATH, '//*[@id="modal-content"]/div/div[2]/div').click()
KeyElement = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, 'captcha-widget')))
key = KeyElement.get_attribute("data-sitekey")
print(key)
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
KEIKAS
  • 11
  • 2

0 Answers0