1、先切换进入到iframe中
driver.switch_to.frame(0) # 0表示要进入到第几个iframe中
再执行操作
2、后续操作没在iframe中时需要先切换回top中
drive.switch_to.parent_frame() # 返回上一层