想使用python3抓取百度網(wǎng)頁信息惕蹄,print時報錯:
UnicodeEncodeError: 'gbk' codec can't encode character '\xbb'.
解決方法是約定標(biāo)準(zhǔn)輸入編碼:
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
想使用python3抓取百度網(wǎng)頁信息惕蹄,print時報錯:
UnicodeEncodeError: 'gbk' codec can't encode character '\xbb'.
解決方法是約定標(biāo)準(zhǔn)輸入編碼:
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')