我正面临着美丽的一些问题。Python 3&BeautifulSoup问题 - [解码错误 - 输出不是utf-8]
我想看过一些网站的标题,当我的代码试图读取一些网站,包含与拉美本地字符的头衔,我得到这个错误:
[Decode error - output not utf-8]
是否有人知道如何解决这个问题?
干杯。
我的代码:
def getTitle(theList):
for element in theList:
response = urllib.request.urlopen(element)
soup = BeautifulSoup(response.read())
title = soup.find("title").text
print (element,": ",title,"\n")
嗨Celeo,谢谢你的回答,我试过了,但我仍然得到同样的错误。有什么想法吗? – 2014-09-03 23:01:47