Added basic parsing code

This commit is contained in:
benjamyn committed 2017-05-22 01:41:57 +10:00
1 parent 961de708e3
commit aba8f7ddb9
1 file changed
+12 -2
+12 -2
View File
@@ -1,8 +1,18 @@
#!/bin/python2.7
from HTMLParser import HTMLParser
import httplib
starttag = ""
class HTMLParse(HTMLParser):
def handle_starttag(self, tag, attrs):
starttag = tag
print starttag
conn = httplib.HTTPSConnection("www.python.org")
conn.request("GET", "/")
r1 = conn.getresponse()
parser = HTMLParse
print r1.read()
parser.feed(r1.read())