Error Description: An error occurred while initializing a firefox browser Using selenium in python code. After reading that the version of selenium is 2.35, I used firefox -- version to check that it is 28.0, firefox seems to be disobedient and automatically upgraded, resulting in the old version of selenium not supported.
Traceback (most recent call last ):
File "C: \ Python27 \ erSiteCompare. py", line 528, in
Sys. exit (main ())
File "C: \ Python27 \ erSiteCompare. py", line 525, in main
Sites. run ()
File "C: \ Python27 \ erSiteCompare. py", line 462, in run
Self. capture ()
File "C: \ Python27 \ erSiteCompare. py", line 353, in capture
Self. startSite1 ()
File "C: \ Python27 \ erSiteCompare. py", line 233, in startSite1
Raise e
Selenium. common. exceptions. WebDriverException: Message: "Can't load the profile.
Profile Dir: c: \ users \ cancelc \ appdata \ local \ temp \ tmp7pjtay Firefox output
:
* ** LOG addons. xpi: startup \ r \ n
* ** LOG addons. xpi: Skipping unavailable install location app-system-local \ r \ n
* ** LOG addons. xpi: Skipping unavailable install location app-system-share \ r \ n
* ** LOG addons. xpi: checkForChanges \ r \ n"
Solution:
Enter sudo pip install-U selenium to upgrade the current selenium version. It automatically connects me to pypi.python.com and obtains a 2.42 version package. After the upgrade, it will work properly.
If the sudo pip prompt cannot be found, you can first which pip and then directly sudo the pip directory, maybe the bin path is not included in bashrc.