python 2.7 - BeautifulSoup parse special character -


i extract text links beautifulsoup like:

from beautifulsoup import beautifulsoup import urllib2  response = urllib2.urlopen(link)  html = response.read()  soup = beautifulsoup(html)   #print(soup)  in soup.findall('a',attrs={"class":"link"}):   print(a.text) 

but characters "&#8211" simple "-". how these characters readable humans?

try following:

for in soup.findall('a',attrs={"class":"link"}):   print(a.get_text()) 

Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -