1

How can i get the recaptcha data-sitekey by selenium on this websie?

https://premier.hkticketing.com/

I have try this code:

data_sitekey = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.CLASS_NAME, "g-recaptcha"))).get_attribute("data-sitekey")
print(data_sitekey)

or

wait = WebDriverWait(driver, 5)
wait.until(EC.frame_to_be_available_and_switch_to_it((By.CLASS_NAME, "g-recaptcha")))

also return Unable to locate element How can I get the data-sitekey to bypass recaptcha?

Leung
  • 23
  • 2
  • Is that precisely the correct URL of the class name? – Libin Thomas Aug 09 '22 at 14:47
  • That frame is itself in another iframe. Review HTML carefully. Swiitch to the first one, wait a little, switch to the next one, wait again, search for the element and iti will be there.Oh, and make sure your selectors are correct. – Barry the Platipus Aug 09 '22 at 14:52

0 Answers0