Py学习  »  Python

如何使用Selenium Python单击#shadow root(closed)内的按钮

Srki • 4 年前 • 3815 次点击  

我试着点击里面的按钮 #shadow-root (closed) ,在iframe内

<iframe title="recaptcha challenge expires in two minutes" 
   <div class="button-holder help-button-holder">
      #shadow-root (closed)
         <link rel="stylesheet" href="chrome-extension://mpbjkejclgfgadiemmefgebjfooflfhl/src/solve/solver-button.css">
         <button tabindex="0" title="Solve the challenge" id="solver-button"></button>
   </div>
</iframe>

这是我用来切换到iframe的

WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[@title='recaptcha challenge expires in two minutes']")))

我如何点击 //button[@id="solver-button"]

以下是它的真实外观

iframe- link

钮扣- link

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/130564
文章 [ 2 ]  |  最新文章 4 年前