python - Raspberry Pi + Selenium + Headless Firefox/Iceweasel - Can't Load Profile -
goal: efficient headless browsing (with python 3) raspberry pi
what i've tried:
(using pip-3.2) installed: selenium v2.45.0, pyvirtualdisplay v0.1.5
(using apt-get) installed: xvfb (latest think v1.12.4?), iceweasel v31.5.3
python 3 code:
from selenium import webdriver pyvirtualdisplay import display display = display(visibile=0, size=(800, 600)) # note: seems work (non-headless) display.start() # without these 2 lines browser = webdriver.firefox() browser.get('http://www.google.com') print(browser.page_source) browser.quit()
error:
traceback (most recent call last): file "/home/pi/desktop/mail-finder.py", line 18, in <module> browser = webdriver.firefox() file "/usr/local/lib/python3.2/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__ self.binary, timeout), file "/usr/local/lib/python3.2/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__ self.binary.launch_browser(self.profile) file "/usr/local/lib/python3.2/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 66, in launch_browser self._wait_until_connectable() file "/usr/local/lib/python3.2/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 105, in _wait_until_connectable raise webdriverexception("can't load profile. profile " selenium.common.exceptions.webdriverexception: message: can't load profile. profile dir: %s if specified log_file in firefoxbinary constructor, check details.
Comments
Post a Comment