I am currently reading Automate the Boring Stuff with Python and trying to learn how to use Selenium. For now, I am just trying to open a webpage and can't even get that to work. I know there are easier ways to launch a webpage with python, but my goal is to work with the webpage content later, so that is why I am using selenium.
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.python.org")
When I run this code, it does successfully launch Firefox but it does not open the web page I specified. This error is also returned.
Traceback (most recent call last):
File "/Users/lbor/Desktop/se.py", line 2, in <module>
driver = webdriver.Firefox()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
self.binary, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 108, in _wait_until_connectable
% (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /var/folders/4c/gsw7v5b118j406zxj3lxctt40000gn/T/tmp_dgwff4s If you specified a log_file in the FirefoxBinary constructor, check it for details.
I don't understand what this problem is or how to go about fixing it. I am running OS 10.12.5, Python 3.6, Selenium 2.53.6, Firefox 53.0.3. As for the geckodriver, I don't know what that is or how to install it.