0

I'm having difficulty getting a chrome portableapps to work with chromedrivers and getting the generic "data:," crash indicator.

all options have zero affect on "data:," outcome:

def start(self, proxy=None):
    # Setup selenium browser with proxy
    options = Options()
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage') # devtoolsactiveport file doesn't exist
    options.add_argument('--no-default-browser-check')
    options.add_argument('--no-first-run')
    options.add_argument('--disable-gpu')
    options.add_argument('--disable-extensions')
    options.add_argument('--disable-default-apps')
    #options.add_argument('--incognito')
    #options.add_argument('--headless')
    #options.add_argument('--hide-scrollbars')
    #options.add_argument('--log-level=3')  # fatal messages only, to subpress other messages
    options.binary_location = self.loc_executable
    if proxy: #optional proxy
        options.add_argument('--proxy-server=%s' % proxy)
    
    # automation hiding
    #options.add_argument('--disable-blink-features=AutomationControlled')
    #options.add_experimental_option('excludeSwitches', ['enable-logging', 'enable-automation'])
    #options.add_experimental_option('useAutomationExtension', False)
    
    # One static browser driver
    self.driver = webdriver.Chrome(options=options, executable_path = self.loc_webdriver)

    self.driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
    self.driver.execute_cdp_cmd('Network.setUserAgentOverride', {"userAgent": user_agent} )
    self.driver.get("https://www.google.com") 

I guess that the portableapps version and chromedriver are miss matched.

  • ChromeDriver 107.0.5304.62 portableapps version 107.0.5304.107

  • ChromeDriver 108.0.5359.71 portableapps version 108.0.5359.99

  • ChromeDriver 90.0.4430.24 portableapps version 90.0.4430

2022-12-22 Edit Some Progress, issue was not version. After applying dir permissions and arg:

chrome_options.add_argument('--user-data-dir=~/.config/google-chrome')

I still crash with:

selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist

When I create a dummy DevToolsActivePort in the user-data-dir, the webdriver will delete the file on run, then crash again.

1 Answers1

0

Solution can be found here: WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

You need to manually set the directory and debug port

options.add_argument('--user-data-dir=C:/projects/...') #any dir with write permission
options.add_argument('--remote-debugging-port=9222') #any port