frame操作
# 进入frame框架
driver.switch_to.frame('属性')
# 进入上级frame框架
driver.switch_to.parent_frame()
# 进入主页面
driver.switch_to.default_content()
切换window
# 获取当前窗口句柄
current_handle = driver.current_window_handle()
# 获取全部窗口句柄
handles = driver.window_handles
# 遍历所有的句柄
for handle in handles:
if handle != current_handle:
# 切换窗口
driver.switch_to.window(handle)