gpt4 book ai didi

Internet Explorer 模式下的 Python Selenium Edge 浏览器

转载 作者:行者123 更新时间:2023-12-04 07:19:07 25 4
gpt4 key购买 nike

我有一个与 Internet Explorer 兼容的网站。
我们激活了 Edge Internet Explorer 模式选项,但我无法使用 Selenium 处理网站。有没有办法在 Selenium 中将 IE 模式与 Edge 一起使用?

最佳答案

您需要从this link下载推荐版本的IE Driver Server然后引用下面的代码在Python中使用Selenium中的Edge IE模式:

from selenium import webdriver

ieOptions = webdriver.IeOptions()
ieOptions.add_additional_option("ie.edgechromium", True)
ieOptions.add_additional_option("ie.edgepath",'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe')
driver = webdriver.Ie(executable_path='E:\webdriver\IEDriverServer.exe', options=ieOptions)

driver.maximize_window()
driver.get('https://www.google.com/')
注:将代码中的路径更改为您自己的路径。
结果:
enter image description here

关于Internet Explorer 模式下的 Python Selenium Edge 浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68617785/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com