Selenium-proxy-authentication icon indicating copy to clipboard operation
Selenium-proxy-authentication copied to clipboard

Selenium browser Headless Mode with Datacenter proxy

Open DenishVaghasiya opened this issue 3 years ago • 3 comments

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

DenishVaghasiya avatar Jan 21 '22 09:01 DenishVaghasiya

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

sergree avatar Nov 04 '22 17:11 sergree

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 avatar Jan 16 '23 18:01 kaliiiiiiiiii

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

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

kaliiiiiiiiii avatar Jan 17 '23 09:01 kaliiiiiiiiii