前提・実現したいこと
pythonのseleniumモジュールでwebスクレイピングをしようとしているものです
chromedriverへのpathを入力したらこのようなエラーがでます
発生している問題・エラーメッセージ
Traceback (most recent call last):
File "C:\Users\masaya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Users\masaya\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 709, in init
restore_signals, start_new_session)
File "C:\Users\masaya\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "seleniumtest.py", line 2, in <module>
driver = webdriver.Chrome(executable_path=r"C:\webdriver\chromedriver.exe")
File "C:\Users\masaya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in init
self.service.start()
File "C:\Users\masaya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
該当のソースコード```python3
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r"C:\webdriver\chromedriver.exe")
driver.get("http://www.yahoo.co.jp")
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
chemdriver2.39のwin32版をダウンロードしました
osはwindows10です
回答2件
あなたの回答
tips
プレビュー