Skip to content

Commit

Permalink
Decoding error resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
nsonaniya2010 authored Nov 21, 2018
1 parent b164cc5 commit 3a96f29
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SubDomainizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,16 @@ def IntJsExtract(self, url, heads):
req = requests.get(url, headers=heads)
else:
req = requests.get('http://' + url, headers=heads)

decoding = req.encoding

if decoding:
decoding = decoding
else:
decoding = 'utf-8'

print(termcolor.colored("Searching for Inline Javascripts.....", color='yellow', attrs=['bold']))

try:
html = req.content.decode(decoding)
minhtml = htmlmin.minify(html, remove_empty_space=True)
Expand All @@ -92,7 +100,13 @@ def ExtJsExtract(self, url, heads):
req = requests.get(url, headers=heads)
else:
req = requests.get('http://' + url, headers=heads)

decoding = req.encoding
if decoding:
decoding = decoding
else:
decoding = 'utf-8'

try:
html = req.content.decode(decoding)
soup = BeautifulSoup(html, features='html.parser')
Expand Down

0 comments on commit 3a96f29

Please sign in to comment.