我正试图从网上抓起一篇文章,并把它写到数据库中。article = article.decode('utf-8')'ascii' codec can't decode byte 0xc3 in position 25729: ordinal not in range(128)article = article.encode('utf-8')UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in
我使用请求和BeautifulSoup与Python3.4从一个可能包含或不包含日语或其他特殊字符的网站中删除信息。r = requests.get(str(url)) print(r.content.decode('utf8'))
soup = BeautifulSoupcan't encode character '\u2606' in position 25: character maps