【问题标题】:I am using Microsoft Edge Chromium with Selenium and I keep on getting the msedge.exe as a startup item我正在将 Microsoft Edge Chromium 与 Selenium 一起使用,并且我继续将 msedge.exe 作为启动项
【发布时间】:2020-09-08 20:12:10
【问题描述】:

这是我在 Microsoft Edge Chromium 浏览器中使用 Selenium 的代码:

from selenium.webdriver.edge.options import Options
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.webdriver import WebDriver

driveroptions = Options()
driveroptions.use_chromium = True
driveroptions.add_argument('--start-maximized')
driveroptions.binary_location = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
service = Service(executable_path="msedgedriver.exe")

driver = webdriver.Edge(options=driveroptions, service=service)

每当我重新启动系统时,我会在任务管理器下的启动中获得超过 100 个 msedge.exe,并获得 100 个类似 Popups picture 的 msedge.exe 命令提示符弹出窗口。我使用 Autoruns 从启动中删除了它们,但重新启动后我又得到了它们。有没有其他人遇到过这个问题?

【问题讨论】:

  • 这是许多人都面临的现有问题。你可以检查这个Link
  • 您能告诉我们 Selenium Web 驱动程序的版本、Selenium 的版本、Edge 浏览器的版本和 OS 构建的版本吗?它可以帮助我们测试问题,也可以帮助缩小问题的范围。感谢您的理解。
  • @Deepak-MSFT Edge 版本:版本 85.0.564.44(官方版本)(64 位) Windows 操作系统版本:版本 1903(操作系统版本 18362.1016)Selenium 版本:4.0.0a5 Selenium Edge chromium web 驱动程序版本:84.0.524.0 当 Edge 版本为 84.0 时,我也遇到了同样的问题。
  • 感谢您提供环境相关信息。我建议您参考this link 中提到的步骤,并尝试使用 Edge 浏览器向 Microsoft 提供反馈。感谢您的理解。
  • 你能不能 1. 让 Edge 命令窗口保持打开状态 2. 打开任务管理器 3. 切换到详细信息选项卡 4. 右键单击​​“名称”列标题 5. 单击“选择列” 6 . 选中“命令行”以将命令行包含在详细信息列表中 7. 发布 msedge.exe 进程及其命令行的屏幕截图,因为它们出现在详细信息列表中,随时模糊任何敏感信息在那里。

标签: python-3.x selenium microsoft-edge


【解决方案1】:

有同样的问题 - 在“启动应用程序”中禁用 Microsoft Edge 实例有所帮助,但每次程序运行时都会创建新实例...

按照 MSDN (https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium?tabs=python) 的推荐使用 msedge-selenium-tools 解决了

问题已经好几天没有出现了。

示例代码:

from msedge.selenium_tools import Edge, EdgeOptions

driverOptions = EdgeOptions()
driverOptions.use_chromium = True
driverOptions.binary_location = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
driverOptions.add_argument("--headless")
driverOptions.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = Edge(options=driverOptions)

#... use your driver

driver.close()
driver.quit()

编辑:

做了一些更多的测试,看起来它只是解决了这个问题的“driverOptions.add_experimental_option("excludeSwitches", ["enable-logging"])"。 (不使用 msedge.selenium_tools)。

【讨论】:

    猜你喜欢
    • 2020-05-03
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 2012-07-17
    • 2013-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多