Skip to content

Commit b8e879d

Browse files
committed
Updated the use of the html module to be compatible with Python 3.9. Resolves #133.
1 parent 31492fa commit b8e879d

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

recon/core/module.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from requests.exceptions import Timeout
2-
import html.parser
2+
import html
33
import http.cookiejar
44
import io
55
import os
@@ -92,12 +92,7 @@ def ascii_sanitize(self, s):
9292

9393
def html_unescape(self, s):
9494
'''Unescapes HTML markup and returns an unescaped string.'''
95-
h = html.parser.HTMLParser()
96-
return h.unescape(s)
97-
#p = htmllib.HTMLParser(None)
98-
#p.save_bgn()
99-
#p.feed(s)
100-
#return p.save_end()
95+
return html.unescape(s)
10196

10297
def html_escape(self, s):
10398
escapes = {

recon/utils/parsers.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from urllib.parse import urlparse
2-
import html.parser
2+
import html
33
import re
44

55
def parse_hostname(s):
@@ -12,8 +12,7 @@ def parse_emails(s):
1212
return re.findall(r'([^\s]+@[^\s]+)', s)
1313

1414
def parse_name(s):
15-
h = html.parser.HTMLParser()
16-
elements = [h.unescape(x) for x in s.strip().split()]
15+
elements = [html.unescape(x) for x in s.strip().split()]
1716
# remove prefixes and suffixes
1817
names = []
1918
for i in range(0,len(elements)):

0 commit comments

Comments
 (0)