Smartproxy / Selenium-proxy-authentication

Example of username and password proxy authentication for use in Selenium
https://smartproxy.com/
MIT License
65 stars 13 forks source link

Selenium browser Headless Mode with Datacenter proxy #2

Closed DenishVaghasiya closed 2 months ago

DenishVaghasiya commented 2 years ago

Hello,

I am facing one issue which stated below:

When I am trying to add extension without headless mode then it works perfectly with datacenter proxies as explained in https://github.com/Smartproxy/Selenium-proxy-authentication, whereas it is not working in headless mode. Can you suggest me what should I have to do here?

selenium.common.exceptions.WebDriverException: Message: unknown error: failed to wait for extension background page to load: chrome-extension://aaofpcleknmphbboehgnfonkinbjapel/_generated_background_page.html from unknown error: page could not be found: chrome-extension://aaofpcleknmphbboehgnfonkinbjapel/_generated_background_page.html (Driver info: chromedriver=97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}),platform=Windows NT 10.0.22000 x86_64)

This is the error.

Thank you in advance.

Regards, Denish Vaghasiya

sergree commented 1 year ago

Solution: you need to use pyvirtualdisplay and disable headless mode. Because headless Chrome does not support extensions.

kaliiiiiiiiii commented 1 year ago

It might actually work using options.add_argument("--headless=chrome") ?

@NoahDrucker Maybe include in README.md in case it works?

Reference: https://stackoverflow.com/a/73079789/20443541

kaliiiiiiiiii commented 1 year ago

@NoahDrucker Maybe include in README.md in case it works?

Nevermind, allready included in main.py ==> close that issue?