Skip to content

Commit

Permalink
Updated the use of the html module to be compatible with Python 3.9. R…
Browse files Browse the repository at this point in the history
…esolves #133.
  • Loading branch information
lanmaster53 committed Aug 25, 2021
1 parent 31492fa commit b8e879d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
9 changes: 2 additions & 7 deletions recon/core/module.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from requests.exceptions import Timeout
import html.parser
import html
import http.cookiejar
import io
import os
Expand Down Expand Up @@ -92,12 +92,7 @@ def ascii_sanitize(self, s):

def html_unescape(self, s):
'''Unescapes HTML markup and returns an unescaped string.'''
h = html.parser.HTMLParser()
return h.unescape(s)
#p = htmllib.HTMLParser(None)
#p.save_bgn()
#p.feed(s)
#return p.save_end()
return html.unescape(s)

def html_escape(self, s):
escapes = {
Expand Down
5 changes: 2 additions & 3 deletions recon/utils/parsers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from urllib.parse import urlparse
import html.parser
import html
import re

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

def parse_name(s):
h = html.parser.HTMLParser()
elements = [h.unescape(x) for x in s.strip().split()]
elements = [html.unescape(x) for x in s.strip().split()]
# remove prefixes and suffixes
names = []
for i in range(0,len(elements)):
Expand Down

0 comments on commit b8e879d

Please sign in to comment.