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

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -