How to filter data and print out string using python beautifulsoup? -


i have code:

import urllib bs4 import beautifulsoup  url = 'http://www.brothersoft.com/synthfont-159403.html' pagehtml = urllib.urlopen(url).read() soup = beautifulsoup(pagehtml)  in soup.select('div.updated.coleft ul a[href]'):     print a.string 

but give me output:

kenneth rundt 

what need whole information inside updated coleft class. should do?

get li elements:

>>> li in soup.select('div.updated.coleft li'): ...     print ' '.join(li.stripped_strings) ...  last updated: dec 27, 2012 license: freeware free os: windows 7/vista/xp requirements: no special requirements publisher: kenneth rundt (4 more applications) 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -