I am trying to write a simple selenium script with python to open some website.It is opening the Firefox but not hitting or opening the URL. I am getting the blank page with the following error.
OS-Redhat Linux, Python 2.7, Selenium 2.46, Firefox 38.0
Traceback (most recent call last):
File "/home/max/Desktop/crawlplan/testingselenium.py", line 2, in <module>
driver= webdriver.Firefox()
File "lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
self.binary, timeout),
File "lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)
File "lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 61, in launch_browser
self._wait_until_connectable()
File "lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 105, in _wait_until_connectable
self.profile.path, self._get_firefox_output()))
selenium.common.exceptions.WebDriverException: Message: 'Can\'t load the profile. Profile Dir: /tmp/tmpXf4bUu Firefox output: 1436187289813\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]\n1436187289814\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]\n1436187289816\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/addons/GMPProvider.jsm\n1436187289817\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/addons/PluginProvider.jsm\n1436187289818\taddons.manager\tDEBUG\tStarting provider: XPIProvider\n1436187289818\taddons.xpi\tDEBUG\tstartup\n1436187289819\taddons.xpi\tINFO\tMapping fxdriver@googlecode.com to /tmp/tmpXf4bUu/extensions/fxdriver@googlecode.com\n1436187289819\taddons.xpi\tINFO\tMapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /usr/lib64/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}\n1436187289820\taddons.xpi\tDEBUG\tcheckForChanges\n1436187289821\taddons.xpi\tDEBUG\tLoaded add-on state from prefs: {"app-profile":{"fxdriver@googlecode.com":{"d":"/tmp/tmpXf4bUu/extensions/fxdriver@googlecode.com","e":false,"v":"2.41.0","st":1436187288000,"mt":1436187288000}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"/usr/lib64/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"38.0","st":1434705241000,"mt":1432076165000}}}\n1436187289822\taddons.xpi\tDEBUG\tgetModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}\n1436187289822\taddons.xpi\tDEBUG\tgetInstallState changed: false, state: {"app-profile":{"fxdriver@googlecode.com":{"d":"/tmp/tmpXf4bUu/extensions/fxdriver@googlecode.com","e":false,"v":"2.41.0","st":1436187288000,"mt":1436187288000}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"/usr/lib64/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"38.0","st":1434705241000,"mt":1432076165000}}}\n1436187289824\taddons.xpi\tDEBUG\tNo changes found\n1436187289824\taddons.manager\tDEBUG\tRegistering shutdown blocker for XPIProvider\n1436187289824\taddons.manager\tDEBUG\tProvider finished startup: XPIProvider\n1436187289825\taddons.manager\tDEBUG\tStarting provider: LightweightThemeManager\n1436187289825\taddons.manager\tDEBUG\tRegistering shutdown blocker for LightweightThemeManager\n1436187289825\taddons.manager\tDEBUG\tProvider finished startup: LightweightThemeManager\n1436187289825\taddons.manager\tDEBUG\tStarting provider: GMPProvider\n1436187289827\taddons.manager\tDEBUG\tRegistering shutdown blocker for GMPProvider\n1436187289828\taddons.manager\tDEBUG\tProvider finished startup: GMPProvider\n1436187289828\taddons.manager\tDEBUG\tStarting provider: PluginProvider\n1436187289828\taddons.manager\tDEBUG\tRegistering shutdown blocker for PluginProvider\n1436187289829\taddons.manager\tDEBUG\tProvider finished startup: PluginProvider\n1436187289829\taddons.manager\tDEBUG\tCompleted startup sequence\n\n(Gecko:7325): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer\' has no property named `window\'\n\n(Gecko:7325): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer\' has no property named `window\'\nconsole.error: \n [CustomizableUI]\n Custom widget with id loop-button does not return a valid node\nconsole.error: \n [CustomizableUI]\n Custom widget with id loop-button does not return a valid node\n*** Blocklist::_preloadBlocklistFile: blocklist is disabled\n1436187290705\taddons.manager\tDEBUG\tStarting provider: <unnamed-provider>\n1436187290705\taddons.manager\tDEBUG\tRegistering shutdown blocker for <unnamed-provider>\n1436187290706\taddons.manager\tDEBUG\tProvider finished startup: <unnamed-provider>\n\n(Gecko:7325): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer\' has no property named `window\'\n\n(Gecko:7325): GLib-GObject-WARNING **: IA__g_object_notify: object class `MozContainer\' has no property named `window\'\n'
Process finished with exit code 1
python Script
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.example.com")