Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions

后端 未结 4 1432
庸人自扰
庸人自扰 2020-12-05 21:18

I\'m just trying to do something very basic on my Mac using selenium and I can\'t even open a webpage. I\'m getting an error of :

Traceback (most recent call         


        
4条回答
  •  [愿得一人]
    2020-12-05 22:17

    The error says it all :

    selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
    

    The error clearly mentions that the chromedriver which is getting detected have wrong permissions.


    Solution

    • Download the latest chromedriver binary from ChromeDriver - WebDriver for Chrome and save it in your system.
    • Ensure that chromedriver binary have the required permissions.
    • While initiating the WebDriver and WebClient pass the argument executable_path along with the absolute path of the chromedriver binary as follows :

      from selenium import webdriver
      
      link = "https://accounts.google.com"
      driver = webdriver.Chrome(executable_path='/path/to/chromedriver')
      driver.get(link)
      

    Reference

    You can find a detailed relevant discussion in:

    • 'Webdrivers' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

提交回复
热议问题