两个方法 driver.current_window_handle 获取当前窗口句柄 driver.window_handles 获取所有窗口句柄 from selenium import webdriver from selenium.webdriver.common.by import By from time import sleep from selenium.common.exceptions import NoSuchElementException driver = webdriv…