-1

How do I integrate selenium webdriver Edge options into EdgeDriver in python?

I tried to use:

from selenium.webdriver.edge.options import Options

# with

from selenium.webdriver import Edge

PS: I do not want to use another package like msedge :)

PicxyB
  • 596
  • 2
  • 8
  • 27

1 Answers1

0

If this is what you are looking for:

from selenium import webdriver

options = webdriver.EdgeOptions()
options.add_experimental_option("detach", True)
driver = webdriver.Edge(options=options)
driver.get("https://www.google.com/")

Note: Options were introduced in Selenium 4. In order to use options, you need to upgrade your selenium to version 4/higher.

Shawn
  • 4,064
  • 2
  • 11
  • 23
  • AttributeError: module 'selenium.webdriver' has no attribute 'EdgeOptions' with selenium 3.141.0 – PicxyB Apr 11 '23 at 13:01
  • 1
    Check the Note in the updated answer. – Shawn Apr 11 '23 at 13:18
  • Hey, I am not really confident about "experimental" options. Is there a specific version of Selenium that allow EdgeWebdriver to have "add_option" instead of "add_experimental_option"? – PicxyB Apr 14 '23 at 12:37