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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -