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)