[Python] Installing Chrome webdriver

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to configure my environment. I was told to download a driver for Chrome, which I did. I downloaded the file to my local Downloads folder, and the name of the file is chromedriver-win64.zip, with 3 files inside.

    Then, I was told to run the 3 lines below:

    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service

    driver = webdriver.Chrome(service=Service("/Users/danielgotlieb/Downloads/chromedriver"))


    The first two were ok. I know I have to change the path inside "" on the 3rd line, but when I tried to use the location of the chrome file, I got an error saying "the path is not a valid file".

    I tried

    driver = webdriver.Chrome(service=Service("/Users/Dell/Downloads/chromedriver"))


    I got:

    Valeu error: the path is not a valid site.


    I don't know what I did wrong. Is it the path? Is it the file name? I'm running the command within PyCharm.

    Continue reading...

Compartilhe esta Página