[Answered ]-Service /usr/bin/chromedriver unexpectedly exited Status code was: 1

1👍

Using the and the Service argument you no more need to pass the executable_path key.

So your effective line of code will be:

driver_location = "/chromedriver_linux64/chromedriver"
driver_ = webdriver.Chrome(options=chrome_options_, service=Service(driver_location))

However using Selenium v4.6 and above Selenium Manager would take care of the chromedriver binary. So your effective code block will be:

chrome_options_ = Options()
chrome_options_.add_argument('--verbose')
chrome_options_.add_argument('--headless')
chrome_options_.binary_location = '/usr/bin/google-chrome'
chrome_options_.add_argument('--no-sandbox')
chrome_options_.add_argument('--disable-dev-shm-usage')
chrome_options_.add_argument('')
driver_ = webdriver.Chrome(options=chrome_options_)

Leave a comment