Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: Thank you again for not praising the bad guys ......
Why are you so eager to learn this? the foundation is not solid, so it is too aggressive. obviously there is no clear idea...
First, the default encoding is required for programming, that is, to add
# -*- coding: utf-8 -*-
Add # coding: UTF-8 before python2 code.
Read three articles on python training for brother Huang
Chinese character encoding for python development crawlers is no longer a problem:
Clear the Chinese characters in python2 with garbled characters at one time
Article/python_bianma.md at master · pythonpeixun/article · GitHub
Python crawlers access multiple websites and process Chinese code.
Python crawlers access multiple websites and process Chinese code.
How does python3 access the sina homepage in Chinese?
How does python3 access the sina homepage in Chinese?
It may be lost in your transfer.
Ur = list (ur)
Ur = ur [:-1]
****************
ur = res.contents[0] ur = list(ur) ur = ur[:-1] temp = unicode(ur[0]) for index in range(0, len(ur), 4): temp = unicode(ur[index]) print temp.strip() print ur[index+1].string print ur[index+1]['href'] print '\n'
It seems that response is followed by two decodes and it should be nice to change the encode...
Decode converts the brackets to Unicode.
Encode is Unicode into brackets, is the UTF-8
Unicode is a transfer station
No, the same building ignore... Use the Requests library to process http Requests.