0

i wanted to start experimenting with selenium with python to automate a few stuff. But i can only open Edge when i place in the options parameter (which i believe still does not work properly). I can open chrome, but only if its driver = webdriver.Chrome(). Any other parameters will either crash, like webdriver.Chrome(executable_path=r"...") or open Edge, like webdriver.Chrome(options=optionss)

The options that i have so far are:

optionss.add_argument("--start-maximized")
optionss.add_argument("--disable-popup-blocking")
optionss.add_argument("--ignore-certificate-errors")

and some more stuff for prefs

Here is the code i have now:

from selenium import webdriver
from selenium.webdriver.edge.options import Options
url = "https://example.site.com"
optionss.add_argument("--start-maximized")
#optionss.add_argument("--disable-popup-blocking")
#optionss.add_argument("--ignore-certificate-errors")
prefs = {
 "download.default_directory": r"C:\example\dir",
 "download.prompt_for_download":False,
 "safebrowsing.enabled":False
 }
optionss.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=optionss)
driver.get(url)

As stated, chrome will open only if there is no options=optionss parameter. Otherwise it will crash or open Edge

This is the error that i get when I have options=optionss in webdriver.Chrome(): SessionNotCreatedException: Message: session not created: No matc hing capabilities found

3
  • show your full code including imports and how you instantiate Options() and Chrome(). Adding arguments to an options instance and using that to launch Chrome works fine. If it doesn't for you, please include the full error message. Commented May 29, 2025 at 0:04
  • Please, see my answer again!! I edited her. Commented Jun 3, 2025 at 14:18
  • You are trying to launch Chrome using Edge options. Don't do that. Commented Jun 10, 2025 at 14:19

3 Answers 3

0

Try this:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
optionss = Options()
optionss.add_argument("--start-maximized")
optionss.add_argument("--disable-popup-blocking")
optionss.add_argument("--ignore-certificate-errors")
driver = webdriver.Chrome(options=optionss)

If you already doing this, please show us all code.

[EDIT]
After you updated the post, i need to ask:

optionss.add_argument()
Is that work?

I'm asking 'cause your "optionss" variable is not an instance of "Options()" and i think is it that cause the crash on webdriver.

answered May 28, 2025 at 20:20
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, new to stack overflow. I just updated the post. I will say that i have tried that. In my experiments, I saw that Chrome opens when there is no parameter in driver = webdriver.Chrome(). Otherwise, it will crash, or it will open Edge
0

You are trying to launch Chrome using Edge options, so it is going to launch Edge instead. Don't do that.

from selenium.webdriver.edge.options import Options

answered Jun 16, 2025 at 13:14

Comments

0

Thank you everyone for your help. Sorry for late response. The simple solution that i found was instead of doing optionss = Options(), do optionss = ChromeOptions()

So simple but yet so weird

answered Jun 16, 2025 at 19:45

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.