当我运行以下代码时,
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
url= "http://couponmaths.com"
htmltext = urllib.request.urlopen(url).read()
soup = BeautifulSoup(htmltext)
print(soup.get_text())
print(soup.prettify())
我收到错误:
UnicodeEncodeError: 'charmap' codec can't encode character '\u201c' in position 16975: character maps to <undefined>
有人可以帮我解决这个问题吗?