The driver is not starting the browser due to the HTTP 400 error to the localhost/session. I'm using proxy to connect to internet
versions
python - 3.10.4
selenium - 4.3.0
webdriver-manager - 3.8.1
code
from selenium import webdriver
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager
from pathlib import Path
import logging
folderPath = str(Path( __file__ ).parent.absolute())
logging.basicConfig(format='[%(asctime)s] - [%(filename)s] - [%(levelname)s] - %(message)s', filename = folderPath + '/logs/seleniumAppLog.log', filemode = 'w', level = logging.DEBUG)
driver = webdriver.Firefox(service = FirefoxService(GeckoDriverManager().install()))
driver.get('https://www.google.com/')
logs
[2022-07-14 11:54:11,735] - [logger.py] - [INFO] - ====== WebDriver manager ======
[2022-07-14 11:54:15,407] - [logger.py] - [INFO] - Get LATEST geckodriver version for 96.0 firefox
[2022-07-14 11:54:15,411] - [connectionpool.py] - [DEBUG] - Starting new HTTPS connection (1): api.github.com:443
[2022-07-14 11:54:16,490] - [connectionpool.py] - [DEBUG] - https://api.github.com:443 "GET /repos/mozilla/geckodriver/releases/latest HTTP/1.1" 200 3015
[2022-07-14 11:54:20,423] - [logger.py] - [INFO] - Getting latest mozilla release info for v0.31.0
[2022-07-14 11:54:20,425] - [connectionpool.py] - [DEBUG] - Starting new HTTPS connection (1): api.github.com:443
[2022-07-14 11:54:21,525] - [connectionpool.py] - [DEBUG] - https://api.github.com:443 "GET /repos/mozilla/geckodriver/releases/tags/v0.31.0 HTTP/1.1" 200 None
[2022-07-14 11:54:21,530] - [logger.py] - [INFO] - About to download new driver from https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-win64.zip
[2022-07-14 11:54:21,535] - [connectionpool.py] - [DEBUG] - Starting new HTTPS connection (1): github.com:443
[2022-07-14 11:54:22,553] - [connectionpool.py] - [DEBUG] - https://github.com:443 "GET /mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-win64.zip HTTP/1.1" 302 0
[2022-07-14 11:54:22,558] - [connectionpool.py] - [DEBUG] - Starting new HTTPS connection (1): objects.githubusercontent.com:443
[2022-07-14 11:54:27,616] - [logger.py] - [INFO] - Driver has been saved in cache [C:\Users\sam\.wdm\drivers\geckodriver\win64\0.31]
[2022-07-14 11:54:28,867] - [remote_connection.py] - [DEBUG] - POST http://localhost:63660/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true, "moz:debuggerAddress": true, "pageLoadStrategy": "normal"}}}
[2022-07-14 11:54:28,868] - [connectionpool.py] - [DEBUG] - Starting new HTTP connection (1): <proxy url here>
[2022-07-14 11:54:28,938] - [connectionpool.py] - [DEBUG] - <proxy url> "POST http://localhost:63660/session HTTP/1.1" 400 0
[2022-07-14 11:54:28,938] - [remote_connection.py] - [DEBUG] - Remote response: status=400 | data= | headers=HTTPHeaderDict({'Server': 'BigIP', 'Connection': 'Keep-Alive', 'Content-Length': '0'})
[2022-07-14 11:54:28,938] - [remote_connection.py] - [DEBUG] - Finished Request
error in console
Traceback (most recent call last): File "C:\Users\sam\Downloads\repo\pendingCM_parser\snowSelenium.py", line 26, in driver = webdriver.Firefox(service = FirefoxService(GeckoDriverManager().install())) File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 177, in init super().init( File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 277, in init self.start_session(capabilities, browser_profile) File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 370, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 435, in execute self.error_handler.check_response(response) File "C:\Program Files\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 211, in check_response raise exception_class(value) selenium.common.exceptions.WebDriverException: Message: