title: Parsing html tags with Python
body: <p>I have been given an url and I want to extract the contents of the <code>&lt;BODY&gt;</code> tag from the url.
  I'm using Python3. I came across <code>sgmllib</code> but it is not available for Python3.</p>
  
  <p>Can someone please guide me with this? Can I use <code>HTMLParser</code> for this?</p>
  
  <p>Here is what i tried:</p>
  
  <pre><code>import urllib.request
  f=urllib.request.urlopen("URL")
  s=f.read()
  
  from html.parser import HTMLParser
  class MyHTMLParser(HTMLParser):
      def handle_data(self, data):
          print("Encountered   some data:", data)
  
  parser = MyHTMLParser()
  parser.feed(s)
  </code></pre>
  
  <p>this gives me error : TypeError: Can't convert 'bytes' object to str implicitly</p>