Configure Chrome driver on mac

Prompt at runtime (even if the path is written, there is no way)

chrome_driver = 'Users/xxx/Downloads/chromedriver'

browser = webdriver.Chrome(executable_path= chrome_driver)

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

————————————————

1. Check the version of Chrome browser, find the chromedriver file under the corresponding version at https://sites.google.com/chromium.org/driver/home and download it. Under the Mac system, download the automatic decompression secondary file. You can also download the corresponding chrome version according to chromedriver, but it may be automatically updated ~ not recommended

2. Move the downloaded file to the /usr/local/bin directory, you can open the terminal, you can switch the directory to move; you can also operate in the folder, but the system file cannot be dragged

  mv xxx /usr/local/bin

2.1. This tool needs to be executed from Recovery OS.

      mv: rename /Users/xxx/Desktop/chromedriver to /opt/chromedriver: Perm

The computer has a protection mechanism. For the host with the M1 chip, restart the computer, and press and hold the power button on the host to enter the Recovery OS (it takes a long time), open the terminal, enter csrutil disable, and enter the password according to the prompt. You can use csrutil status to view the status, and csrutil enable to restore

2.2. mv: rename chromedriver to /usr/local/bin: Permission denied

Insufficient permissions, you can use sudo chmod -R 777 + path to add permission to change, the system cannot be changed

Guess you like

Origin blog.csdn.net/wdy_1004/article/details/127257805