Python Regex Help
Question: I am trying to sort through HTML tags and I can't seem to get it right.

What I have done so far

    
    
    import urllib
    import re
    
    s = raw_input('Enter URL: ')
    f = urllib.urlopen(s) 
    s = f.read() 
    f.close 
    r = re.compile('<TAG\b[^>]*>(.*?)</TAG>',)
    result = re.findall(r, s)
    print(result)
    

Where I replace "TAG" with tag I want to see.

Thanks in advance.


Answer: You should really try using libraries which can perform HTML parsing out of
the box. Beautiful Soup is one of my favorites.

