str_demo = b'\xe4\xbd\xa0\xe5\xa5\xbd'
str_decode = str_demo.decode(encoding='utf-8') print(str_decode)
你好
byte_demo = b'\xe4\xbd\xa0\xe5\xa5\xbd'
byte_decode = byte_demo.decode(encoding='utf-8') print(byte_decode)
你好
json_demo = '{"name": "Tom", "age": 18, "sex": "male"}'
import json json_decode = json.loads(json_demo) print(json_decode)
{'name': 'Tom', 'age': 18, 'sex': 'male'}
标签: 百度爬虫