Selenium won't login into websites once deployed to linux server

Viewed 54

I have created a page to login into frequently used sites by clicking on icons and it works fine locally. Once I deployed it to a linux server it doesn't work. I get this error, 'selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home'

Here is my code:

 def loginToShipstation(request):
   username = "xxx"
   password = "xxx"
   url = "https://ss.shipstation.com/"
   driver = webdriver.Chrome("C:/chromedriver")
   driver.get(url)
   driver.find_element_by_name("username").send_keys(username)
   driver.find_element_by_id("password").send_keys(password)
   time.sleep(1)
   driver.find_element_by_id("btn-login").click()
   return HttpResponse()
1 Answers

Change that PATH driver = webdriver.Chrome("C:/chromedriver") to wherever you installed it - there's no C: on Linux.

Related