2017-11-07 8 views
1

私は両方の文書をチェックしてみたが、答えが見つからなかった。'Webdrivers'の実行ファイルに間違った権限がある可能性があります。 https://sites.google.com/a/chromium.org/chromedriver/home

私はInstaPyをPython用のInstagram APIを使用しようとしています。複数のエラーで失敗し、InstaPyがいくつかの問題を抱えていると仮定したので、私はseliniumを使用して生のコードを作成しようとしました。サンプルコードを挿入して好きなものに変更した後、私はちょうどこのコードが動作することを確認しました。私は古いものの代わりに新しいエラーを受け取り、権限が正しくないかもしれないと言っています。私は再インストールと管理者として実行しようとしましたが、何も動作しません。どのように私はこの問題を解決するか、および/または、これは

コードどういう意味:

import time 
from selenium import webdriver 

driver = 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-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start 
    stdout=self.log_file, stderr=self.log_file) 
    File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 707, in __init__ 
    restore_signals, start_new_session) 
    File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 990, in _execute_child 
    startupinfo) 
PermissionError: [WinError 5] Access is denied 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Webdrivers\RawBot.py", line 5, in <module> 
    driver = webdriver.Chrome('C:\Webdrivers') # Optional argument, if not specified will search path. 
    File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__ 
    self.service.start() 
    File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.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 

答えて

0

エラーすると、すべてのWebDriverException: Message: 'Webdrivers' executable may have wrong permissions.言います。

あなたは試してみています

driver = webdriver.Chrome('C:\Webdrivers') # Optional argument, if not specified will search path. 

いくつかの単語:Windowsでは

  1. を、あなたは明示的にバイナリ拡張子と一緒にそれを提供する必要がchromedriverバイナリのパスを指定している場合。 Windowsでは

  2. は、chromedriverバイナリパスを言及しながら、あなたは生の(r)スイッチと一緒に単一のフロントスラッシュ(/)を使用するか持っているか、あなたが戻ってエスケープを使用する必要が(\\)を大幅に削減。

  3. だから、行は次のようになります。

    driver = webdriver.Chrome(executable_path=r'C:/Utility/BrowserDrivers/chromedriver.exe') 
    
0

あなたが「chromedriver.exe」である完全なファイル名を入力したときにこれは解決しました。あなたが窓にいるならこれを試してください

関連する問題