I'm trying to switch to this frame
<iframe id="CaptchaFrame" title="画像認識" src="about:blank" horizontalscrolling="no" verticalscrolling="no" scrolling="no">
</iframe>
But it is covered in another frame:
<iframe frameborder="0" scrolling="no" id="fc-iframe-wrap" aria-label=" " style="width: 330px; height: 305px;" src="https://paypal-api.arkoselabs.com/fc/gc/?token=556633290cf3549a4.4740334104&r=ap-southeast-1&metabgclr=transparent&guitextcolor=#000000&metaiconclr=#757575&meta=7&meta_height=305&meta_width=330&lang=ja&pk=9409E63B-D2A5-9CBD-DBC0-5095707D0090&at=40&ag=101&cdn_url=https://paypal-api.arkoselabs.com/cdn/fc&lurl=https://audio-ap-southeast-1.arkoselabs.com&surl=https://paypal-api.arkoselabs.com&smurl=https://paypal-api.arkoselabs.com/cdn/fc/assets/style-manager"></iframe>
How can I make it? Please help me
CodePudding user response:
@duyanhhz you can first switch to the outer iframe and then you can switch into the one you want.
outer = driver.find_element(By.ID, "fc-iframe-wrap")
driver.switch_to.frame(outer)
inner = driver.find_element(By.ID, "CaptchaFrame")
driver.switch_to.frame(inner)