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 "–
" simple "-
". how these characters readable humans?
try following:
for in soup.findall('a',attrs={"class":"link"}): print(a.get_text())
Comments
Post a Comment