0

I am trying to extract the data-hcaptcha-response from the hcaptcha iframe using undetected_driver or selenium. However, it would not work.

ctx.execute_script("document.title = 'test'")
print(ctx.title)
time.sleep(1)
ctx.execute_script('document.getElementsByTagName("iframe")[0].getAttribute("data-hcaptcha-response")')
print(ctx.title)
  • I'm not sure but you should rather run all in one script. – furas Mar 26 '22 at 06:01
  • maybe it will need `switch_to.frame` to access ` – furas Mar 26 '22 at 06:02
  • better create minimal working code with real URL so we could simply copy and run it - to test problem. But frankly, captcha was created to block bots/script and it should effective. – furas Mar 26 '22 at 06:03

0 Answers0