■python 3.6
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless') options.add_argument('--no-sandbox') driver = webdriver.Chrome(executable_path='/path/to/chromedriver',chrome_options=options) driver.get('https://yahoo.co.jp') print(driver.title)
▽エラー内容
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib64/python3.6/subprocess.py", line 729, in init
restore_signals, start_new_session)
File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/chromedriver': '/path/to/chromedriver'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "index.py", line 9, in <module>
driver = webdriver.Chrome(executable_path='/path/to/chromedriver',chrome_options=options)
File "/usr/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init
self.service.start()
File "/usr/lib/python3.6/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
エラーの解消方法をご教授いただきたいです。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。