FIX: Stopped the parser from printing all data from the starttag, turns out o forgot to reset the variable when it encounters the endtag... *facepalm

This commit is contained in:
Benjamyn Love 2017-05-22 02:23:55 +10:00
parent cb706839bc
commit f230a5bb80

View File

@ -12,17 +12,24 @@ class MyHTMLParser(HTMLParser):
global conf_temp
global starttag
if tag == conf_temp:
# starttag = tag
for name, value in attrs:
if name == "class" and value == "df-raw":
print tag
starttag = tag
pass
starttag = tag
# pass
#print starttag
def handle_endtag(self, tag):
global starttag
if tag == "pre":
starttag = ""
def handle_data(self, data):
#print starttag
if starttag == conf_temp:
print data
pass
conn = httplib.HTTPSConnection("www.whois.com")