19 lines
351 B
Python
Executable File
19 lines
351 B
Python
Executable File
#!/bin/python2.7
|
|
from HTMLParser import HTMLParser
|
|
import httplib
|
|
|
|
starttag = ""
|
|
|
|
class MyHTMLParser(HTMLParser):
|
|
def handle_starttag(self, tag, attrs):
|
|
starttag = tag
|
|
print starttag
|
|
|
|
|
|
conn = httplib.HTTPSConnection("www.python.org")
|
|
conn.request("GET", "/")
|
|
r1 = conn.getresponse()
|
|
parser = MyHTMLParser()
|
|
|
|
parser.feed(r1.read())
|