Python 3 HTML Parse

Wednesday, 13 April 2011, 347

Sample code for HTML parsing with Python 3.

>>> from html.parser import HTMLParser
>>> parss=HTMLParser()
>>> parss.feed('<a href="http://m-eken.com">link</a>')
>>> parss.get_starttag_text()
'<a href="http://m-eken.com">'
>>>


Leave a comment
Name(required)
Mail (will not be publishing) (required)
Website

  • "I am a dreamer. Seriously, I'm living on another planet."
  • Lütfü Hoca

  • Categories

  • Archives