1

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")
Jeya Kumar
  • 1,002
  • 1
  • 13
  • 36
  • What firefox and selenium versions are you using? – alecxe Jul 06 '15 at 13:00
  • Sorry i forget to mention that.I am using OS-Redhat Linux, Python 2.7, Selenium 2.46 – Jeya Kumar Jul 06 '15 at 13:02
  • Thanks. What about firefox? – alecxe Jul 06 '15 at 13:02
  • I am using Firefox 38.0 – Jeya Kumar Jul 06 '15 at 13:05
  • Just a sanity check: downgrade firefox to, say, 36 and try again. – alecxe Jul 06 '15 at 13:12
  • 2
    I found the issue.Actually i was using selenium 2.32 (that s the default in my production location where i run my code) .Previously i checked the version in local location[version 2.46] now i upgraded the selenium to 2.46 in production location and everything is working fine. – Jeya Kumar Jul 06 '15 at 13:35
  • After you started using proper selenium version did the warning remain or it was gone and so was related to the exception? – Nakilon Sep 24 '15 at 13:56
  • @Nakilon : After I updated the selenium version to 2.46 in production location It started to load the pages without any issue – Jeya Kumar Sep 24 '15 at 14:07
  • @user3768218, I'm seeing it on 2.47 but didn't yet found my issue roots. – Nakilon Sep 24 '15 at 15:04
  • @Nakilon : I am not sure about your issue, Please have a look at [http://stackoverflow.com/questions/7347494/selenium-webdriver-geturl-does-not-open-the-url] . It may help you. – Jeya Kumar Sep 30 '15 at 12:27

0 Answers0