<div class="one">       //1号
    <iframe src="https://www.XXX.com/../X.html?a=b&c=d width="400" height="600">   //2号
          #document    //3号
             <html>
                  .......
              </html>
    </iframe>
</div>
 
我想 switch_to.iframe 到 iframe。
但它没 id  也没有 class .
我就先定位 到 1 号   的 div 
iframe_div = d.find_elements_by_css_selector('one')
然后在定位 到 iframe    2 号位
iframe_self = d.find_element_by_tag_name('iframe')
最后
iframe = driver.switch_to.iframe(iframe_self)
发现切换不过去,iframe 是空。
是为什么呢?
#document 里面就是 iframe 打开的页面。
在当前页上打开一个小窗口