如果顯示是類型錯(cuò)誤的,可以先看一下自己數(shù)據(jù)庫(kù)那個(gè)表id那欄有沒有點(diǎn)下面的自動(dòng)遞增!
2018-01-26
正確的:
import io
import sys
import urllib.request
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
res=urllib.request.urlopen('http://www.baidu.com')
htmlBytes=res.read()
print(htmlBytes.decode('utf-8'))
import io
import sys
import urllib.request
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
res=urllib.request.urlopen('http://www.baidu.com')
htmlBytes=res.read()
print(htmlBytes.decode('utf-8'))
2018-01-09
報(bào)這個(gè)UnicodeEncodeError: 'gbk' codec can't encode character u'\xa9' in position 89190: illegal multibyte sequence錯(cuò)的改下cmd的print的編碼就好
2018-01-09
強(qiáng)烈推薦安裝anaconda這個(gè)Python的第三方發(fā)行版https://anaconda.org/
2018-01-06
沒有人報(bào)這個(gè)錯(cuò)嗎 報(bào)錯(cuò):ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED]
解決辦法:import ssl
ssl._create_default_https_context = ssl._create_unverified_context
解決辦法:import ssl
ssl._create_default_https_context = ssl._create_unverified_context
2018-01-06
下載報(bào)錯(cuò):UnicodeEncodeError:'ascii'編解碼器不能編碼11-13位置的字符:序號(hào)不在范圍內(nèi)(128)
2017-12-26
UnicodeEncodeError:'ascii'編解碼器不能編碼11-13位置的字符:序號(hào)不在范圍內(nèi)(128)
2017-12-26