51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3046|回复: 3
打印 上一主题 下一主题

[求助] selenium2.48+Firefox42报错,是不兼容吗

[复制链接]
  • TA的每日心情
    无聊
    10 小时前
  • 签到天数: 410 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2018-10-11 11:32:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    代码如下:

    1. # coding = utf-8
    2. from selenium import webdriver
    3. browser = webdriver.Firefox()
    4. browser.get("http://www.baidu.com")

    5. browser.find_element_by_id("kw").send_keys("selenium")
    6. browser.find_element_by_id("su").click()

    7. browser.quit()
    8. 出错:
    9. Traceback (most recent call last):
    10.   File "C:\Python27\selenium_exercise\ex1.py", line 3, in <module>
    11.     browser = webdriver.Firefox()
    12.   File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 77, in __init__
    13.     self.binary, timeout),
    14.   File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
    15.     self.profile.add_extension()
    16.   File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 91, in add_extension
    17.     self._install_extension(extension)
    18.   File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 260, in _install_extension
    19.     if not os.path.isdir(os.path.dirname(os.path.join(tmpdir, name))):
    20.   File "C:\Python27\lib\ntpath.py", line 108, in join
    21.     path += "\\" + b
    22. UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 9: ordinal not in range(128)
    复制代码


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    12 小时前
  • 签到天数: 2668 天

    连续签到: 5 天

    [LV.Master]测试大本营

    2#
    发表于 2018-10-12 11:37:49 | 只看该作者
    报错字符集?
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    2020-10-23 14:19
  • 签到天数: 51 天

    连续签到: 1 天

    [LV.5]测试团长

    3#
    发表于 2018-10-12 14:40:15 | 只看该作者
    编码冲突
    回复

    使用道具 举报

  • TA的每日心情

    2024-4-19 09:36
  • 签到天数: 942 天

    连续签到: 1 天

    [LV.10]测试总司令

    4#
    发表于 2018-10-15 10:08:19 | 只看该作者
    编码冲突
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-10 19:52 , Processed in 0.065469 second(s), 21 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表