“Webdrivers”可執行文件可能具有錯誤的權限請參閱https://sites.google.com/a/chromium.org/chromedriver/home
此錯誤消息…
WebDriverException: Message: ’Webdrivers’ executable may have wrong permissions.
…表示您嘗試使用的 ChromeDriver 版本具有錯誤的權限。
您似乎已經嘗試過:
driver = webdriver.Chrome(’C:Webdrivers’) # Optional argument, if not specified will search system $PATH variable.
幾句話:
如果您的基礎操作系統是windows:
您必須從ChromeDriver下載位置下載 并解壓縮以使用。此外,如果您明確指定 Chromedriver 二進制路徑,則還必須附加二進制擴展名,即 chromedriver.exe 。在提及 Chromedriver 二進制路徑時,您必須使用單個正斜杠(即(/)原始(r)開關),或者必須使用轉義的反斜杠(即)()。因此,您的有效代碼行將是:driver = webdriver.Chrome(executable_path=r’C:/path/to/chromedriver.exe’)
如果您的基礎操作系統是linux:
您必須從ChromeDriver下載位置下載 ,然后解壓縮才能使用。此外,如果您明確指定 Chromedriver 二進制路徑, 為可執行二進制文件提供任何擴展名,即 chromedriver 。在提及 Chromedriver 二進制路徑時,您必須使用單個正斜杠,即(/)。因此,您的有效代碼行將是:driver = webdriver.Chrome(executable_path=’/path/to/chromedriver’)
如果您的基礎操作系統是macos:
您必須從ChromeDriver下載位置下載 并解壓縮才能使用。此外,如果您明確指定 Chromedriver 二進制路徑, 為可執行二進制文件提供任何擴展名,即 chromedriver 。在提到chromedriver二進制路徑時,您必須使用單個正斜杠,即(/)。因此,您的有效代碼行將是:driver = webdriver.Chrome(executable_path=’/path/to/chromedriver’)解決方法
我四處查看了兩個文檔,但沒有找到答案。
我一直在嘗試使用InstaPy一個用于python的instagramapi。在因多個錯誤而失敗并假設InstaPy僅存在一些問題之后,我嘗試使用selenium精對其進行原始編碼。在插入示例代碼并將其更改為我喜歡的方式之后,我只是確保此代碼可以正常工作。我收到一個新錯誤,而不是舊錯誤,說權限可能不正確。我嘗試重新安裝并以管理員身份運行,但沒有任何效果。我該如何解決和/或這意味著什么
碼:
import timefrom selenium import webdriverdriver = webdriver.Chrome(’C:Webdrivers’) # Optional argument,if not specified will search path.driver.get(’http://www.google.com/xhtml’);time.sleep(5) # Let the user actually see something!search_box = driver.find_element_by_name(’q’)search_box.send_keys(’ChromeDriver’)search_box.submit()time.sleep(5) # Let the user actually see something!driver.quit()
錯誤:
Traceback (most recent call last): File 'C:Program Files (x86)Python36-32libsite-packagesseleniumwebdrivercommonservice.py',line 74,in start stdout=self.log_file,stderr=self.log_file) File 'C:Program Files (x86)Python36-32libsubprocess.py',line 707,in __init__ restore_signals,start_new_session) File 'C:Program Files (x86)Python36-32libsubprocess.py',line 990,in _execute_child startupinfo)PermissionError: [WinError 5] Access is deniedDuring handling of the above exception,another exception occurred:Traceback (most recent call last): File 'C:WebdriversRawBot.py',line 5,in <module> driver = webdriver.Chrome(’C:Webdrivers’) # Optional argument,if not specified will search path. File 'C:Program Files (x86)Python36-32libsite-packagesseleniumwebdriverchromewebdriver.py',line 62,in __init__ self.service.start() File 'C:Program Files (x86)Python36-32libsite-packagesseleniumwebdrivercommonservice.py',line 86,in start os.path.basename(self.path),self.start_error_message)selenium.common.exceptions.WebDriverException: Message: ’Webdrivers’ executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
相關文章:
1. javascript - 能否讓vue-cli的express修改express重啟服務2. 解決Android webview設置cookie和cookie丟失的問題3. javascript - gulp打包引入文件路徑在生產環境和開發環境下的切換4. node.js - npm一直提示proxy有問題5. python - 我想把下面代碼中的多余空白行去除該怎么做,如何用正則實現6. PHP單例模式7. 最新版本的微信web開發者工具必須要APPID,會提供測試號,但是像你一樣tabBar配置的話不會顯示首頁與日志,難道我要下載跟你一樣的版本?8. 網頁爬蟲 - python爬蟲翻頁問題,請問各位大神我這段代碼怎樣翻頁,還有價格要登陸后才能看到,應該怎么解決9. python - tweepy 庫 連接Twitter API 報錯10. python - 網頁title中包含換行,如何用正則表達式提取出來?
