Hi,
I believe headless chrome was enabled on my account. I've upgraded selenium and am running this simple test script:
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_options)
try:
browser.get("https://www.google.com")
print("Page title was '{}'".format(browser.title))
finally:
browser.quit()
However, I get the following error:
Traceback (most recent call last):
File "/home/manwithfewneeds/.local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.7/subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1499, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver': 'chromedriver'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/manwithfewneeds/.local/lib/python3.7/test_selenium.py", line 6, in <module>
browser = webdriver.Chrome(options=chrome_options)
File "/home/manwithfewneeds/.local/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py",
line 73, in __init__
self.service.start()
File "/home/manwithfewneeds/.local/lib/python3.7/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.co
m/a/chromium.org/chromedriver/home
It doesn't appear that chromedriver is in my PATH (at least I can't find it in the file system). Any help please?