webdriver_manager icon indicating copy to clipboard operation
webdriver_manager copied to clipboard

Problem with creating the driver

Open marchqbismart opened this issue 1 year ago • 5 comments

Hello,

I'm using selenium and the webdriver_manager package for a bot. I'm currently using it in a function app with python in docker, locally. I had the problem of the THIRD_PARTY file but it's already solved.

Now, if I run the function locally (without docker) it goes okey, but runnig it in docker, it keeps running in the driver creation and keeps 10 minutes charging untill it stops automatically. The function was working some days ago before the version of Chrome changed...

There's someone with the same problem?

Code here:

user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.88 Safari/537.36 Edg/95.0.1020.30"

    chrome_options = webdriver.ChromeOptions()
    download_directory = os.path.join(os.getcwd(), 'files')
    download_directory2 = os.path.join(os.getcwd(), 'screenshots')

    if not os.path.exists(download_directory):
        os.makedirs(download_directory)

    if not os.path.exists(download_directory2):
        os.makedirs(download_directory2)

    prefs = {'download.default_directory': download_directory}
    chrome_options.add_experimental_option('prefs', prefs)
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument("--disable-dev-shm-usage")
    chrome_options.add_argument("--window-size=1920x1080")
    chrome_options.add_argument(f"user-agent={user_agent}")

    service = Service(ChromeDriverManager().install())
    driver = webdriver.Chrome(service=service, options=chrome_options)

The problem is in the last line, the service is correctly created.

marchqbismart avatar Jul 31 '24 08:07 marchqbismart

I have the same issue. Hard-coding the driver path, the one of the previous version of the driver, and skipping installation step altogether helped.

glsch avatar Aug 01 '24 08:08 glsch

Where can I find the chromedriver for chrome version=127? ERROR - Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 127.0.6533.73 with binary path

SacrilegeTx avatar Aug 01 '24 13:08 SacrilegeTx

I was running my script every day and I had quite a collection of older drivers stored in a specific folder (YOUR_USER_FOLDER/.wdm/drivers/chromedriver/... on Mac).

glsch avatar Aug 04 '24 15:08 glsch

Same error. This needs resolution OR the chrome is not usable by webdriver_manager anymore as of this version.

praditik avatar Aug 05 '24 13:08 praditik

chrome_path = ChromeDriverManager().install()
if "THIRD_PARTY_NOTICES.chromedriver" in chrome_path:
    chrome_path = chrome_path.replace("THIRD_PARTY_NOTICES.chromedriver", "chromedriver")

CalebePrates avatar Aug 06 '24 18:08 CalebePrates