当前位置: 代码迷 >> 综合 >> webdriver 打开多个url用多个标签
  详细解决方案

webdriver 打开多个url用多个标签

热度:44   发布时间:2023-12-05 22:59:18.0
from selenium import webdriver
self.browser = webdriver.Chrome()
for i in range(0, len(urls)):url = urls[i]windows_open = "window.open('" + url + "')"self.browser.execute_script(windows_open)

如果需要开多个窗口:

for i in range(0, len(urls)):url = urls[i]self.browser = webdriver.Chrome()windows_open = "window.open('" + url + "')"self.browser.execute_script(windows_open)
  相关解决方案