I cant install ChromeDriverManager with ChromeDriverManager().install()
Asked Answered
C

3

5

I've been learning Python for 2 month, and this error has never occurred to me once but all of a sudden I can't download CHROMEDRIVERMANAGER and whenever I get to its website to download it manually it says This XML file does not appear to have any style information. The document tree is shown below. The error: ` Access Denied Access denied.

We're sorry, but this service is not available in your location

This XML file does not appear to have any style information associated with it. The document tree is shown below.

Access denied Access denied. We're sorry, but this service is not available in your location

` this is the error that I am getting trying to download CHROMEDRIVER I believe its because my code requests to download CHROMEDRIVER the error pops up the same one that pops up when I try to download it My code

import selenium.webdriver.chrome.webdriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
import pyautogui
from webdriver_manager.chrome import ChromeDriverManager
import random
import numpy as np
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By

options = Options()
options.add_experimental_option("detach", True)
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),
options=options)
driver.get("https://www.pinterest.com/ideas/")

apparently, something is wrong with the line where I said what is the driver

Conjoint answered 23/7, 2023 at 18:58 Comment(0)
F
10

Change the below line from:

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

TO:

driver = webdriver.Chrome(service=Service(ChromeDriverManager(version="114.0.5735.90").install()),options=options)

Above should solve your issue. Having said that, with latest selenium(v4.6.0 or above), you don't really need ChromeDriverManager to download/handle browser drivers. Selenium's new tool known as SeleniumManager will do what ChromeDriverManager used to do. So the code now can be simplified as below:

options = Options()
options.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=options)
driver.get("https://www.pinterest.com/ideas/")

References - Introducing Selenium Manager

Fiddlededee answered 24/7, 2023 at 8:56 Comment(0)
E
0

You don't need to install Chrome driver. You can use your chrome installed in your pc. I can share my some code. Please try like this.

import pkg_resources
chromeOptions = webdriver.ChromeOptions()
driver_path = pkg_resources.resource_filename(__name__, "chromedriver.exe")
browser = webdriver.Chrome(executable_path=driver_path, options=chromeOptions)
Endocentric answered 24/7, 2023 at 9:34 Comment(0)
A
0

You are running an outdated version of webdriver-manager.

Execute pip install webdriver-manager==4.0.0

Aerostat answered 13/9, 2023 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.