0

I just starting playing around with python and following a tutorial of selenium started to get errors. I pip install selenium and imported webdriver from selenium; however, when I use command browser = webdriver.Firefox() it gives all these error. I do have Firefox installed. any help appreciated. this is in windows 10 with python3

Traceback (most recent call last):
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\George\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
miatech
  • 2,150
  • 8
  • 41
  • 78
  • now i'm getting this error why so difficult SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape – miatech Dec 07 '19 at 20:41
  • What line is the syntax error on? – alexyorke Dec 07 '19 at 20:42
  • it is just a command entered in the console. browser = webdriver.Firefox("C:\Users\George\AppData\Local\Mozilla Firefox\firefox.exe") – miatech Dec 07 '19 at 20:47
  • Try `browser = webdriver.Firefox(r"C:\Users\George\AppData\Local\Mozilla Firefox\firefox.exe")` (the `r` before the string means to treat each character literally; the slashes need to be escaped.) – alexyorke Dec 07 '19 at 20:49

0 Answers0