前提・実現したいこと
seleniumにて、ヘッドレスオプション使うとエラーが出て起動しません。
起動するための助言をお願いいたします。
発生している問題・エラーメッセージ
エラーメッセージ Traceback (most recent call last): File "C:\Users\ユーザー名\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "C:\Users\ユーザー名\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "C:\Users\ユーザー名\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 "C:/Python/test.py", line 6, in <module> driver = webdriver.Chrome(options=options) File "C:\Users\ユーザー名\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in __init__ self.service.start() File "C:\Users\ユーザー名\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' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home ### 該当のソースコード ```Python from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless') driver = webdriver.Chrome(options=options) driver = webdriver.Chrome('c:/chromedriver/chromedriver.exe') driver.get('https://www.python.org/') print('END') driver.quit() exit()
環境
Windows7
python3.6 32bit
ChromeDriver 2.45

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/29 11:12