how to select a particular html tag using python -
how select <span class="wlb_wrapper">
tags http://www.imdb.com/genre/action/?ref_=gnr_mn_ac_mp? have done far , returning []
:
import urllib beautifulsoup import beautifulsoup import re url="http://www.imdb.com/genre/action/?ref_=gnr_mn_ac_mp" page=urllib.urlopen(url).read() soup = beautifulsoup(page) body = soup.findall('span', {'class': 'wlb_wrapper'}) body=str(body) o=open("output.txt","w") o.write(body) o.close()
Comments
Post a Comment