簡體   English   中英

切換到框架 Python Selenium

[英]Switch to frame Python Selenium

我正在嘗試切換到這個框架

   <iframe class="wrapper" id="CaptchaFrame" title="畫像認識" src="about:blank" horizontalscrolling="no" verticalscrolling="no" scrolling="no">
            </iframe>

但它被另一個框架覆蓋:

<iframe frameborder="0" scrolling="no" id="fc-iframe-wrap" class="fc-iframe-wrap" aria-label=" " style="width: 330px; height: 305px;" src="https://paypal-api.arkoselabs.com/fc/gc/?token=556633290cf3549a4.4740334104&amp;r=ap-southeast-1&amp;metabgclr=transparent&amp;guitextcolor=%23000000&amp;metaiconclr=%23757575&amp;meta=7&amp;meta_height=305&amp;meta_width=330&amp;lang=ja&amp;pk=9409E63B-D2A5-9CBD-DBC0-5095707D0090&amp;at=40&amp;ag=101&amp;cdn_url=https%3A%2F%2Fpaypal-api.arkoselabs.com%2Fcdn%2Ffc&amp;lurl=https%3A%2F%2Faudio-ap-southeast-1.arkoselabs.com&amp;surl=https%3A%2F%2Fpaypal-api.arkoselabs.com&amp;smurl=https%3A%2F%2Fpaypal-api.arkoselabs.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager"></iframe>

我怎樣才能做到? 請幫我

@duyanhhz 您可以先切換到外部 iframe ,然后您可以切換到您想要的那個。

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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM