Reputation: 183
I'm trying to scrape and print the HTML of a page using Selenium
in Python
, but every time I run it I get the error message
Firefox quit unexpectedly.
I'm new to Selenium, so any help would be greatly appreciated. I'm hoping for the simplest fix possible. Thank you!
My code:
import selenium
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/')
print browser.page_source
Upvotes: 13
Views: 4361
Reputation: 3256
Upgrading Selenium from 2.45 to 2.47 worked for me.
Selenium 2.46 fixes support for Firefox 38 (and looks like 39 as well). See the release notes
Upvotes: 2
Reputation: 346
My experience since the upgrade to Firefox 38.x on Windows a couple of weeks back has been that it has a problem with Selenium 2.45.x. When invoking the browser it produces a "Firefox has stopped working" error which I have to close manually, at which point the test runs. Others have reported similar issues.
The solution that worked for me (apart from manually closing the error each time, which got old after a few days) was to uninstall the latest version of Firefox and downgrade to version 37.0.2 on the machine where I run the tests. Not ideal for security reasons, but OK if you're careful.
Upvotes: 7
Reputation: 167
What version of firefox are you using? firefox 36 started breaking for me with selenium version 2.43.0 . You can upgrade to 2.45 and check. https://code.google.com/p/selenium/issues/detail?id=8399 They mention at the end that there are fixes for ff 36 in 2.45. For ff 37 and beyond I'm not sure. I downgraded my ff to work with the version of selenium I had.
Upvotes: 1