Как мне установить веб-драйвер firefox для работы с selenium \ python
Я установил его с помощью команды
pip install selenium
Я попробовал этот код:
driver=webdriver.Firefox()
driver.get("https://www.google.com")
content=driver.find_element_by_id("lga")
print(content)
Но это дает мне эту ошибку
Traceback (most recent call last):
File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\lib\site-package
s\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\lib\subprocess.p
y", line 775, in __init__
restore_signals, start_new_session)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\lib\subprocess.p
y", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\Class.py", line 3, in <module>
class Scrap:
File ".\Class.py", line 4, in Scrap
driver = webdriver.Firefox()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\lib\site-package
s\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python37-32\lib\site-package
s\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable
needs to be in PATH.