【发布时间】:2014-11-07 17:31:37
【问题描述】:
我正在使用Python 使用BeautifulSoap 进行网络抓取
我收到此错误
'charmap' codec can't encode character '\xae' in position 69: character maps to <undefined>
抓取网页时
这是我的Python
hotel = BeautifulSoup(state.)
print (hotel.select("div.details.cf span.hotel-name a"))
# Tried: print (hotel.select("div.details.cf span.hotel-name a")).encode('utf-8')
【问题讨论】:
-
看起来这可能是问题所在:stackoverflow.com/a/4197411/2372812。您需要比您提供的
# Tried:行更早地设置编解码器。 -
我做了,但没有区别
标签: python web-scraping beautifulsoup