[问题] 找网络上的范例(下载视频)但显示错误?

楼主: epapitera (清风无极)   2014-10-14 23:32:08
各位大大好
我在网络上看到有人教学 如何下载某视频的教学
(http://bbs.csdn.net/topics/390361293)
于是我存成get_page.py档
接着开启cmd切到python资料夹 输入get_page.py http://v.163.com/special/
opencourse/paradigms.html
但会显示以下error message 可否请各位大大能帮忙看一下哪里出错?
C:\Python27\practice zone>get_page.py
http://v.163.com/special/opencourse/paradigms.html
Traceback (most recent call last):
File "C:\Python27\Pitera practice zone\get_page.py", line 54, in <module>
main(sys.argv)
File "C:\Python27\Pitera practice zone\get_page.py", line 51, in main
downlaod(argv[1])
File "C:\Python27\Pitera practice zone\get_page.py", line 27, in downlaod
print title.h2.string
UnicodeEncodeError: 'cp950' codec can't encode character u'\xcb' in position
0:illegal multibyte sequence
谢谢大大
作者: alibuda174 (阿哩不达)   2014-10-15 00:03:00
应该是编码问题吧 抓到的是GB2312 却想以CP950输出
作者: uranusjr (←這人是超級笨蛋)   2014-10-15 00:12:00
请往上找这篇 --> [问题] python读档时不认得中文字?
作者: wohtp (会喵喵叫的大叔)   2014-10-15 00:16:00
千错万错都是windows的错! XD#1KDFJYEG 没想到这么快就被洗上去一页了

Links booklink

Contact Us: admin [ a t ] ucptt.com