当定位的元素在iframe标签中

 

 

 

 

1、先切换进入到iframe中

driver.switch_to.frame(0)   # 0表示要进入到第几个iframe中

再执行操作

 

2、后续操作没在iframe中时需要先切换回top中

drive.switch_to.parent_frame()   # 返回上一层

 

posted @ 2022-10-13 11:57  人可何1  阅读(21)  评论(0编辑  收藏  举报