python无法打开 firefox浏览器_【求助】pycharm不能打开火狐浏览器

在尝试使用Python的Selenium库打开Firefox浏览器时遇到错误,具体表现为在安装扩展时出现UnicodeDecodeError,原因是ASCII编码无法解码字节。问题可能源于文件路径包含非ASCII字符。
摘要由CSDN通过智能技术生成

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Traceback (most recent call last):

File "D:/tool/python/pycharm/py/day02.py", line 4, in

driver=webdriver.Firefox()

File "D:\tool\python\Python27\lib\site-packages\selenium-2.53.6-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 80, in __init__

self.binary, timeout)

File "D:\tool\python\Python27\lib\site-packages\selenium-2.53.6-py2.7.egg\selenium\webdriver\firefox\extension_connection.py", line 50, in __init__

self.profile.add_extension()

File "D:\tool\python\Python27\lib\site-packages\selenium-2.53.6-py2.7.egg\selenium\webdriver\firefox\firefox_profile.py", line 92, in add_extension

self._install_extension(extension)

File "D:\tool\python\Python27\lib\site-packages\selenium-2.53.6-py2.7.egg\selenium\webdriver\firefox\firefox_profile.py", line 262, in _install_extension

if not os.path.isdir(os.path.dirname(os.path.join(tmpdir, name))):

File "D:\tool\python\Python27\lib\ntpath.py", line 85, in join

result_path = result_path + p_path

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5 in position 7: ordinal not in range(128)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值