0

Here is what I am trying to type in:

web = 'https://www.actionnetwork.com/mlb/odds'
path = '/Users/Downloads/chromedriver'
driver = webdriver.Chrome(path)

and this is the error I am receiving after that last line:

Warning (from warnings module):
  File "<pyshell#5>", line 1
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
Traceback (most recent call last):
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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 "<pyshell#5>", line 1, in <module>
    driver = webdriver.Chrome(path)
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 89, in __init__
    self.service.start()
  File "C:\Users\mynew\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

So I tried this:

warnings.filterwarnings("ignore", category=DeprecationWarning)

and I get this:

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    warnings.filterwarnings("ignore", category=DeprecationWarning)
NameError: name 'warnings' is not defined. Did you mean: 'Warning'?

Like I said, this is my first time using Python so I am extremely lost on what to do from here.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
  • You have to specify the correct chromedriver `.exe` file. For warnings, `import warnings` will do – Coderio Sep 22 '22 at 01:09
  • Welcome to Stack Overflow. If you're on a Windows system, why are you referring to the ```'/Users/Downloads/chromedriver'``` path? Wouldn't it be ```C:\\Users\\Downloads\\chromedriver.exe```? or something similar? – ewokx Sep 22 '22 at 01:09
  • @ewokx Better to use forward slashes still; see [Windows path in Python](https://stackoverflow.com/questions/2953834/windows-path-in-python). – Karl Knechtel Sep 22 '22 at 01:14

0 Answers0