BeautifulSoup findall with class attribute- unicode encode error
问题 I am using BeautifulSoup to extract news stories(just the titles) from Hacker News and have this much up till now- import urllib2 from BeautifulSoup import BeautifulSoup HN_url = "http://news.ycombinator.com" def get_page(): page_html = urllib2.urlopen(HN_url) return page_html def get_stories(content): soup = BeautifulSoup(content) titles_html =[] for td in soup.findAll("td", { "class":"title" }): titles_html += td.findAll("a") return titles_html print get_stories(get_page() ) When I run the