'list' object has no attribute 'head' code example

Example 1: myhtmlparser object has no attribute pos python

from html.parser import HTMLParser

class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print("Encountered a start tag:", tag)

    def handle_endtag(self, tag):
        print("Encountered an end tag :", tag)

    def handle_data(self, data):
        print("Encountered some data  :", data)

parser = MyHTMLParser()
parser.feed('<html><head><title>Test</title></head>'
            '<body><h1>Parse me!</h1></body></html>')

Example 2: AttributeError: 'list' object has no attribute 'dtypes'

data = np.array(data, dtype=np.float32)