code: def extracthtmlurls(mesg):
      
      chunk = HTMLChunker()
      chunk.feed(mesg)
      chunk.close()
      # above_context = 1
      # below_context = 1
  
      def somechunkisurl(chunks):
          for chnk in chunks:
              if chnk.url is not None:
                  return True
          return False
  
      return extract_with_context(chunk.rval, somechunkisurl, 1, 1)
docs: Extract URLs with context from html type message. Similar to extracturls.