标签:switch color script port www pen sele class handles
from selenium import webdriver import time driver=webdriver.Chrome() driver.get("http://www.douban.com/") time.sleep(2) driver.execute_script(‘window.open("http:www.163.com/")‘) time.sleep(2) driver.execute_script(‘window.open("http:www.jd.com/")‘) time.sleep(2) driver.execute_script(‘window.open("http:www.baidu.com/")‘) #回到第一个页面 pages=driver.window_handles driver.switch_to.window(pages[0])
标签:switch color script port www pen sele class handles
原文地址:https://www.cnblogs.com/luckiness/p/13401465.html