Here is my code:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get(\'http://www.python.org\')
browser.close()
It
This could be for various reasons.
Most probably because the "latest" version of your geckodriver is not able to communicate with your "slightly older" firefox.
The easiest way to fix this would be to try out different older versions of geckodriver. Run the following command to find the current version of your geckodriver
geckodriver --version
If it shows the version as 19 or above, execute following steps to use geckodriver version 17(Works 90% of times)
Your existing geckodriver most typically may be placed in /usr/local/bin when u installed it earlier. First delete this by running sudo rm -r /usr/local/bin/geckodriver
Download version 17 of geckodriver from this link.
Move the downloaded file(geckodriver-v0.17.0-arm7hf.tar.gz) from your Downloads folder into your home directory
Unpack the file
tar -xzvf geckodriver-v0.17.0-arm7hf.tar.gz
This will create a folder called "geckodriver" in your home directory
Move/Copy this extracted "geckodriver" into /usr/local/bin/
sudo cp geckodriver /usr/local/bin/
Run
sudo reboot
Rerun your program now...
It should work!