+1 vote

I get the following error:

Traceback (most recent call last):
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 992, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/ishaq/AppData/Local/Programs/Python/Python36/headless.py", line 9, in <module>
driver = webdriver.Chrome(executable_path=os.path.abspath("chromedriver"),   chrome_options=chrome_options)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 81, 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.com/a/chromium.org/chromedriver/home

And my script is:

import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.binary_location =
r'C:\Users\ishaq\Desktop\chrome\chromedriver.exe'
driver = webdriver.Chrome(executable_path=os.path.abspath("chromedriver"),
chrome_options=chrome_options)
driver.get("http://www.duo.com")

magnifying_glass = driver.find_element_by_id("js-open-icon")
if magnifying_glass.is_displayed():
magnifying_glass.click()
else:

search_field = driver.find_element_by_id("site-search")
search_field.clear()
search_field.send_keys("Olabode")
search_field.send_keys(Keys.RETURN)
assert "Looking Back at Android Security in 2016" in driver.page_source
driver.close()
May 10, 2018 in Selenium 76,443 views
hey brother,

can i get ur mail ID so that we ccan discuss about the webdriver problems

You can also handle this error with python script:

In command line:

pip install webdriver-manager


Python script:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
answered Nov 27, 2018 by Srujan

selected Jan 10, 2020 by Kalgi
Thank you Sir, it works!
Hi, this is one of the few solutions that has worked for me perfectly! Thank you.

Do you know how I prevent Chrome from launching every time I run my code with this ChromeDriverManager?
I would only like to see the web scraping results, not the web pages displayed in the Chrome browser.
Hello, @scrapes. I hope you are doing well.

Please do register at Edureka Community and upvote the answer if it has helped you.

Hi Srujan,

I am able to install webdriver-manager using command "pip install --user webdriver-manager".

But I am still getting error.

ModuleNotFoundError: No module named 'webdriver_manager'.
Below is my code.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time

driver = webdriver.Chrome(ChromeDriverManager().install()).

Make sure you have properly installed selenium as well. If not, use the following to install it,

python -m pip install -U selenium

Later use your code to install web driver.

It works, thanks
I am getting this error while trying to install webdriver:

Fatal error in launcher: Unable to create process using '"c:\users\dibyajyoti.a.sahoo\appdata\local\programs\python\python37-32\python.exe"  "C:\Users\dibyajyoti.a.sahoo\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe" install webdriver-manager': The system cannot find the file specified.

Hey @Dibya, have u tried srujan's solution?

Also refer to https://www.edureka.co/blog/selenium-using-python/

Hope this helps!

I am getting following with above code can anyone help here?

Traceback (most recent call last):
File "chrome_code.py", line 2, in <module>
from webdriver_manager.chrome import ChromeDriverManager
File "/home/delhivery/Desktop/lambdatest/venv/lib/python3.5/site-packages/webdriver_manager/chrome.py", line 4, in <module>
from webdriver_manager.driver import ChromeDriver
File "/home/delhivery/Desktop/lambdatest/venv/lib/python3.5/site-packages/webdriver_manager/driver.py", line 77
^
SyntaxError: invalid syntax

Hello @ Akshat Garg,

Have  you tried to import the package called webdriver_manager? if not you can installed it by:

pip install webdriver_manager

Also this can be done automatically using webdriver-manager

Note:Our system needs to know where to locate the chromedriver.exe. You could put it into a directory that is in your system's PATH variable, or just tell the constructor where it is:

browser = webdriver.Chrome('C:\\path\\to\\chromedriver.exe')
THIS WORKED WONDERS!!!! THANK YOU
Hi, thank you for your contribution to the Edureka Community.

Register/Sign up on the community to gain points for further contributions. You may ask questions, answer, upvote, and downvote an answer. Each of these would fetch you points and you could be among the top contributors and win exciting merchandise from Edureka.

Cheers!
+1 vote

Very basic error. The main issue is with the path and driver execuable. So it's clear from the error that the Python client was unable to locate the chromedriver binary. When your mentioning the path of the driver, append it with the extension. Like this:

driver = webdriver.Chrome(executable_path=os.path.abspath("chromedriver.exe")
• 3,710 points
Thank you guys! The one with green tick worked for me :)

You can test if it actually is in the PATH, if you open a cmd and type in chromedriver (assuming your chromedriver executable is still named like this) and hit Enter. If Starting ChromeDriver 2.15.322448 is appearing, the PATH is set appropriately and there is something else going wrong.

Alternatively, you can use a direct path to the chromedriver like this:

 driver = webdriver.Chrome('/path/to/chromedriver')


 driver = webdriver.Chrome("C:/Users/michael/Downloads/chromedriver_win32/chromedriver.exe"
• 10,520 points

Then you have multiple options:

• put it in the same directory as your python script
• specify the location directly via executable_path

driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe')
• 65,890 points

+1 vote

Error message: “'chromedriver' executable needs to be available in the path”

Okay there are a couple of wrong ...READ MORE

+1 vote

Error throwing org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH

Don't use firefox.exe in the end e.g. ...READ MORE

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE