Python: Parsing HTML with BeautifulSoup -


<a href="/watch?gl=us&amp;client=mv-google&amp;hl=en&amp;v=0c_yxohjxwg">miss black ocu 2011</a>  

my program reads html file, , above chunk of file. want grab miss black ocu 2011 using beautifulsoup in python. suggestions?

i suggest looking @ attributes of tag , navigablestring class

text = """<a href="/watch?gl=us&amp;client=mv-google&amp;hl=en&amp;v=0c_yxohjxwg">miss black ocu 2011</a>""" soup = beautifulsoup(text) print soup.find('a').text 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -