Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arsenic doesn’t support all ChromeOptions? #143

Open
FCKJesus opened this issue Dec 22, 2021 · 3 comments
Open

arsenic doesn’t support all ChromeOptions? #143

FCKJesus opened this issue Dec 22, 2021 · 3 comments

Comments

@FCKJesus
Copy link

I tried to migrate ChromeOptions settings from Selenium, but I get an unknown error. Is there a list of all supported ChromeOptions?
Or a way to transfer these?

options = ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--disable-extensions')
options.add_argument('--disable-dev-shm-usage')
options.add_argument("--disable-blink-features")
options.add_argument('--disable-application-cache')
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_argument('user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36')
options.add_experimental_option('useAutomationExtension', False)
options.add_experimental_option('excludeSwitches', ['enable-automation', 'enable-logging'])
options.add_experimental_option('prefs', {"profile.managed_default_content_settings.images": 2, 'disk-cache-size': 0})
additional_options = {'useAutomationExtension': False, 'excludeSwitches': ['enable-automation', 'enable-logging'], 'prefs': {"profile.managed_default_content_settings.images": 2, 'disk-cache-size': 0}}

args=[
	'--headless',
	'--no-sandbox',
	'--disable-gpu',
	'--disable-extensions',
	'--disable-dev-shm-usage',
	'--disable-blink-features',
	'--disable-application-cache',
	'--disable-blink-features=AutomationControlled',
	'user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36'
]

kwargs = {'goog:chromeOptions': dict(additional_options=additional_options, args=args)}

browser = browsers.Chrome(**kwargs)
@FCKJesus FCKJesus changed the title arsenic doesn’t support all ChromeOptions arsenic doesn’t support all ChromeOptions? Dec 22, 2021
@konstunn
Copy link
Contributor

konstunn commented Jan 7, 2022

As far as I have concerned you have tried two ways (two code blocks) and none of these two ways worked for you, didn't they?

@sivagavvala
Copy link

@FCKJesus Hi, have you found any alternatives to add above prefs in arsenic ?

@bojanpotocnik
Copy link

Does anybody have any updates/tips for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants