TA的每日心情 | 擦汗 3 小时前 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
代码如下:
- # 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)
复制代码
|
|