I want to parse some tags.
and the pattern is
<div id="tags">blah-blah<a href="http://url/tag">What_I_Want</a></div>
I thought it works
re.findall(">"."</a></div>")
but it wasn't
what's wrong with that?
------------ Update I ------------- now i know re is not good with html.
raj give me a answer
>>> from bs4 import BeautifulSoup
>>> s = '<div id="tags">blah-blah<a href="http://url/tag">What_I_Want</a></div>'
>>> soup = BeautifulSoup(s)
>>> soup.select('div > a:first')[0].text
'What_I_Want'
and i have another question. how can i find
<div id blah blah </div>
in entire file?