【发布时间】:2020-06-04 16:26:38
【问题描述】:
我一直在尝试使用 selenium 中的 webdriver 在 Internet Explorer 中打开多个浏览器窗口。一旦它到达 get(url) 行,它就会停在那里并最终超时。我添加了一个不执行的打印行。我尝试了各种方法,下面的一个是我用来在 Chrome 中打开多个标签的代码的 Ie 版本。即使我删除了前 3 行,它仍然只能打开 google.com。我已经用谷歌搜索了这个问题并查看了其他帖子,但没有任何帮助。非常感谢任何建议,谢谢!
options = webdriver.IeOptions()
options.add_additional_option("detach", True)
driver = webdriver.Ie(options = options, executable_path=r'blahblah\IEDriverServer.exe')
driver.get("http://google.com")
print("syrfgf")
driver.execute_script("window.open('about:blank', 'tab2');")
driver.switch_to.window("tab2")
driver.get("http://yahoo.com")
【问题讨论】:
-
尝试更改google.com -> google.com?
-
可能是
https://www.google.com? -
没什么区别
标签: python selenium selenium-webdriver webdriver