python+selenium无法用firefox加载网页

最近在学习selenium遇到的这个问题,只能打开firefox,之后就没法加载url,公司的电脑我试下是可以的,网上搜了很多资料也没有解决,很纠结,请大家帮忙看看...
python代码:
from selenium import webdriver
from time import sleep

s = webdriver.Firefox()
s.get('https://www.baidu.com')
s.find_element_by_id('kw').send_keys('python')
sleep(3)

s.find_element_by_id('su').click()
sleep(5)

s.quit()
打印的报错信息:
Traceback (most recent call last):
File "D:/python/new.py", line 5, in
s = webdriver.Firefox()
File "C:\Python27\lib\site-packages\selenium-2.48.0-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 77, in init
self.binary, timeout),
File "C:\Python27\lib\site-packages\selenium-2.48.0-py2.7.egg\selenium\webdriver\firefox\extension_connection.py", line 49, in init
self.binary.launch_browser(self.profile)
File "C:\Python27\lib\site-packages\selenium-2.48.0-py2.7.egg\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable()
File "C:\Python27\lib\site-packages\selenium-2.48.0-py2.7.egg\selenium\webdriver\firefox\firefox_binary.py", line 103, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
我的环境是:
python2.7.11 selenium2.48 Firefox42

3个回答

你的firefox的profile是否有问题。

sinat_29601163
SJD_Dream 回复oyljerry: 怎么看有没有问题啊?手动打开firefox是可以的
接近 4 年之前 回复

楼上的回答很风趣,有可能是版本不兼容

楼主后来解决了吗,我也遇到这个问题了。。。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!