wpakt
wpakt

Reputation: 1083

Opening a Splinter Browser using Selenium

When I initiate a splinter browser object for Chrome, I would get a yellow banner saying "You are using an unsupported command-line flag..." I found a way to get rid of that using selenium.

browser = Browser('chrome')
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
browser = webdriver.Chrome(chrome_options=options)

As you can see, it is actually initiating the browser twice, but I only want Chrome to pop up once. Is there a way to launch the browser of the Splinter object using Selenium?

Upvotes: 2

Views: 1807

Answers (1)

artyomboyko
artyomboyko

Reputation: 2871

I didn't find any way to do that. I'm using custom selenium version with this patch

https://github.com/artyomboyko/splinter/commit/934a254028887d2abc001e44d7ceceb37700c02d

Now I can do this

from selenium.webdriver.chrome.options import Options
from splinter import Browser

options = Options()
options.add_argument('test-type')
browser = Browser('chrome', options=options)

I will try make pull request, sorry but never done it before.

Upvotes: 1

Related Questions