测试积点老人 发表于 2018-10-11 11:32:10

selenium2.48+Firefox42报错,是不兼容吗

代码如下:
# coding = utf-8
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.baidu.com")

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

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

jingzizx 发表于 2018-10-12 11:37:49

报错字符集?

cclovely 发表于 2018-10-12 14:40:15

编码冲突

梦想家 发表于 2018-10-15 10:08:19

编码冲突
页: [1]
查看完整版本: selenium2.48+Firefox42报错,是不兼容吗