I am making a selenium based project to do something but while I was doing it I encountered a error in which if I use headless
mode it shows the error but when i dont it doesn't.
I tried not using headless
mode and it seemed to be working but when I tried it didnt I want to use headless mode so give fix.
My code:
def new_driver():
options = Options()
options.add_extension("proxy.zip")
options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ["enable-logging"])
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=options)
return driver
This is my driver code which makes the driver i think the driver launchs tho the error im getting is:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to wait for extension background page to load: chrome-extension://lgknfaobibciggbigdkldiecibigdfgm/_generated_background_page.html
from unknown error: page could not be found: chrome-extension://lgknfaobibciggbigdkldiecibigdfgm/_generated_background_page.html
I tried using the disable extension option but it still didnt work