Boa tarde!
Estou tentando instalar o Selenium pelo Jupyter para fazer um scraping mas sempre me deparo com um erro quando foi utilizar o webdriver.
pip install selenium
from selenium import webdriver
driver = webdriver.Firefox()
Que gera o seguinte erro.
Alguém consegue me ajudar ?
FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 75 stderr=self.log_file, ---> 76 stdin=PIPE) 77 except TypeError:
~\AppData\Local\Continuum\anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text) 774 errread, errwrite, --> 775 restore_signals, start_new_session) 776 except:
~\AppData\Local\Continuum\anaconda3\lib\subprocess.py in executechild(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session) 1177 os.fspath(cwd) if cwd is not None else None, -> 1178 startupinfo) 1179 finally:
FileNotFoundError: [WinError 2] O sistema não pode encontrar o arquivo especificado
During handling of the above exception, another exception occurred:
WebDriverException Traceback (most recent call last) in ----> 1 driver = webdriver.Firefox()
~\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in init(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, options, service_log_path, firefox_options, service_args, desired_capabilities, log_path, keep_alive) 162 service_args=service_args, 163 log_path=service_log_path) --> 164 self.service.start() 165 166 capabilities.update(options.to_capabilities())
~\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 81 raise WebDriverException( 82 "'%s' executable needs to be in PATH. %s" % ( ---> 83 os.path.basename(self.path), self.start_error_message) 84 ) 85 elif err.errno == errno.EACCES:
WebDriverException: Message: 'geckodriver' executable needs to be in PATH.