发现网页布局嵌套了frame,但是操作frame中的按钮,弹出的窗口定位于frame之外
#跳进
driver.switch_to.frame("id/class")
#跳出
driver.switch_to.default_content()
当frame不存在id或者class时,可以用xpath的方式进行定位
iframe = find_element_by_xpath("//div/iframe")
switch_to_frame(iframe)
发现网页布局嵌套了frame,但是操作frame中的按钮,弹出的窗口定位于frame之外
#跳进
driver.switch_to.frame("id/class")
#跳出
driver.switch_to.default_content()
当frame不存在id或者class时,可以用xpath的方式进行定位
iframe = find_element_by_xpath("//div/iframe")
switch_to_frame(iframe)