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

前端 未结 11 571
醉梦人生
醉梦人生 2020-11-22 16:23

I\'ve looked around checked both documentations and have found no answer.

I\'ve been trying to use InstaPy a instagram api for python. After failing with multiple er

11条回答
  •  感情败类
    2020-11-22 17:01

    had same issue in django.

    However when I ran the same code locally (not activating my django app) it was fine and didn't have to explicitly define the path to the chrome driver.

    Got around it by explicitly defining the path and the chromederiver.exe

    similar to the answer above. path = "C:/Users/YOUR_USER/Desktop/chromedriver/chromedriver.exe"

    in my case, since I want to eventually post my app I used dynamic paths

    ie.

    import os
    
    BASE_oaAPP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    BASE_oaAPP_Utilities_DIR  = os.path.join(BASE_oaAPP_DIR, 'mySubFolderInTheApp')
    
    def utilsPathFileName(fileName):
        return os.path.join(BASE_oaAPP_Utilities_DIR, fileName)
    
    chrome_path = utilsPathFileName('chromedriver.exe')
    driver = webdriver.Chrome(chrome_path)
    

提交回复
热议问题