selenium-wire icon indicating copy to clipboard operation
selenium-wire copied to clipboard

Selenium wire taking a long time on opening browser

Open Mobeen-Ghaffar opened this issue 4 years ago • 6 comments

I am working on browser automation using selenium-wire. But its long time on starting browser. I am using chrome and chromedriver lastest version. Is there any solution for it?

Mobeen-Ghaffar avatar Sep 18 '21 12:09 Mobeen-Ghaffar

What kind of delay are you seeing when starting the browser? Can you share the code you're using?

wkeeling avatar Sep 19 '21 15:09 wkeeling

    chromedriver = "resources/driver/chromedriver.exe"
    options =  ChromeOptions()
    options.add_argument('--ignore-certificate-errors')
    options.add_argument('--ignore-ssl-errors')
    options.add_argument("--disable-notifications")
    options.add_argument('--disable-sync')
    # options.add_argument("--headless")
    # options.add_argument("--window-size=1920,1080")
    options.add_argument("--disable-popup-blocking")
    options.add_argument("--no-sandbox")
    options.add_argument("--disable-gpu")
    options.add_argument("--disable-dev-shm-usage")
    options.add_argument("--allow-running-insecure-content")
    options.add_argument('--log-level=3')
    options.add_argument('--ignore-certificate-errors-spki-list')
    options.add_argument('--disable-logging')
    # options.add_argument('--ignore-ssl-errors')
    # options.add_argument('--proxy-server=snkrs-us-pw-2.resdleafproxies.com:13795')
    prefs={
        "credentails_enable_service":False,
        "profile.password_manager_enabled":False,
        "profile.managed_default_content_settings.images":2,
        "javascript":2
    }
    options.add_argument("--start-maximized")
    options.add_argument("--disable-popup-blocking")
    options.add_argument("--disable-notifications")
    options.binary_location = 'resources/Chrome/chrome.exe'
    
    proxyoptions = {
        # 'mitm_http2': False,
        # 'verify_ssl': False,
        'backend': "mitmproxy",
        'mitm_http2': False,
        'disable_capture': True,
        'verify_ssl': True,
        'connection_keep_alive': False,
        'max_threads': 3,
        'connection_timeout': None,
        'proxy': {
            'http': f'http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}',
            'https': f'http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}',
        }
    }
   driver = Chrome(executable_path=chromedriver,options=options,seleniumwire_options=proxyoptions)

Mobeen-Ghaffar avatar Sep 19 '21 17:09 Mobeen-Ghaffar

Here is my code. I taking usually 1-2 minutes to open up chrome browser

Mobeen-Ghaffar avatar Sep 19 '21 17:09 Mobeen-Ghaffar

Any idea why it taking so long?

Mobeen-Ghaffar avatar Sep 21 '21 08:09 Mobeen-Ghaffar

That looks ok as far as I can see so I'm not sure why it's taking so long. Does it take the same amount of time if you use pure Selenium?

wkeeling avatar Sep 21 '21 17:09 wkeeling

Issue in undetected_chromedriver v2 version. Undetected_chromedriver v1 version works fine.

Mobeen-Ghaffar avatar Sep 30 '21 20:09 Mobeen-Ghaffar