-2

I already tried the solutions found in another posts without any success.

Every time I have tried to use python with selenium WebDrive in pycharm I get the same error, error log:

"selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. I already downloaded the Geckodriver exe file and added the link to systems variables but the message didn't change.

Thank you

Al Imran
  • 882
  • 7
  • 29

1 Answers1

0

I have used Selenium with python on Ubuntu Linux. For selenium i have been working with chrome driver. Following code i am using for a long time.

chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--window-size=%s" % WINDOW_SIZE)
chrome_options.binary_location = CHROME_PATH
driver = webdriver.Chrome(executable_path="ChromDriver/chromedriver",chrome_options=chrome_options)

Here chrome_options.binary_location = CHROME_PATH is the location of chrome binary path where it is located after installation of google chrome. In my case it was /usr/bin/google-chrome Moreover executable_path="ChromDriver/chromedriver" is the location of chromediver for selenium which is placed inside ChromDriver directory with source code.

Usama Tahir
  • 65
  • 2
  • 13