I am new in python. I started working in selenium using python. When I write the below code, it is showing an error message. Can anyone please help me? I cannot find out where is the problem?
code:
from selenium import webdriver
path = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(path)
driver.get("https://www.youtube.com")
result/output:
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
<ipython-input-7-0bc80c8facaf> in <module>
----> 1 driver.get("https://www.youtube.com")
c:\users\md ekramul mostaquim\appdata\local\programs\python\python39\lib\site-packages\selenium\webdriver\remote\webdriver.py in get(self, url)
331 Loads a web page in the current browser session.
332 """
--> 333 self.execute(Command.GET, {'url': url})
334
335 @property
c:\users\md ekramul mostaquim\appdata\local\programs\python\python39\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
319 response = self.command_executor.execute(driver_command, params)
320 if response:
--> 321 self.error_handler.check_response(response)
322 response['value'] = self._unwrap_value(
323 response.get('value', None))
c:\users\md ekramul mostaquim\appdata\local\programs\python\python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):
WebDriverException: Message: chrome not reachable
(Session info: chrome=87.0.4280.88)