1

I have developed a python script for selenium automation. Which is automatically open the selenium chrome browser and login into a particular website. It works perfect in the localhost server. Now I deployed it into the cpanel server by following this tutorial. But when I start to run it it says 500 Internal Server Error.

options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("--headless")
browser = webdriver.Chrome(options=options, executable_path='chromedriver')
wait = WebDriverWait(browser, 10)

error is causing fro the above code.

I checked with the error log

selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

But chromedriver and the script are in the same directory I added option('--headless') in the code please help me to overcome this error. I'm very beginner in cpanel

noobCoder
  • 94
  • 1
  • 14
  • I believe you can find your answer in this post: https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path – DSteman Oct 15 '20 at 11:38
  • no this not working I'm hosting on it cpanel – noobCoder Oct 15 '20 at 12:03

1 Answers1

0

By default, . eg, current directory is not in PATH on linux/osx shells.

Also, even if would be, there might be a chance that the python script is started with working directory different than where it actually is located.

You need to either at the location where your chromedriver is located to PATH before executing the python script, or provide that path as absolute location or, try to location the chromedriver binary before creating Chrome instance and pass it to executable_path

rasjani
  • 7,372
  • 4
  • 22
  • 35