Eu instalei o pacote python3-selenium apt no Ubuntu 16.04. Durante a instalação, recebi uma mensagem:
Suggested packages:
chromedriver firefoxdriver
The following NEW packages will be installed:
python3-selenium
Quando tento executar o seguinte código python,
#! /usr/bin/python3.5
from selenium import webdriver
import time
def get_profile():
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.privatebrowsing.autostart", True)
return profile
def main():
browser = webdriver.Firefox(firefox_profile=getProfile())
#browser shall call the URL
browser.get("http://www.google.com")
time.sleep(5)
browser.quit()
if __name__ == "__main__":
main()
Eu recebo o seguinte erro:
Traceback (most recent call last):
File "./test.py", line 19, in <module>
main()
File "./test.py", line 11, in main
browser = webdriver.Firefox(firefox_profile=getProfile())
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox /webdriver.py", line 77, in __init__
self.binary, timeout),
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
self.profile.add_extension()
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 91, in add_extension
self._install_extension(extension)
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 251, in _install_extension
compressed_file = zipfile.ZipFile(addon, 'r')
File "/usr/lib/python3.5/zipfile.py", line 1009, in __init__
self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib /firefoxdriver/webdriver.xpi'
Eu pesquisei por pacotes nome firefoxdriver nos repositórios do Ubuntu, mas nenhum existe.
Qualquer ajuda sobre a instalação dos drivers da Web foi apreciada.