HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
349 stars 52 forks source link

arsenic doesn’t support all ChromeOptions? #143

Open FCKJesus opened 2 years ago

FCKJesus commented 2 years ago

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)
konstunn commented 2 years ago

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 commented 2 years ago

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

bojanpotocnik commented 1 year ago

Does anybody have any updates/tips for this issue?