切换句柄
#切换句柄(2个标签)
handles = driver.window_handles
current_handles = driver.current_window_handle
for handle in handles:
if handle != current_handles:
driver.switch_to.window(handle)
# 切换句柄(3个标签)
sencond_handle = driver.current_window_handle
handles = driver.window_handles
for handle in handles:
if handle !=sencond_handle and handle != current_handles:
driver.switch_to.window(handle)