PyBaiduYuyin
PyBaiduYuyin copied to clipboard
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.
response = urlopen("https://openapi.baidu.com/oauth/2.0/token", data=urlencode(data))
response = urlopen("https://openapi.baidu.com/oauth/2.0/token", data=urlencode(data).encode('utf-8'))
你肯定是在用python3 改为urlencode(data).encode('utf-8') 就行了。