Created
June 1, 2020 15:48
-
-
Save m4ll0k/1c13f771495484b7b21366feb0b4a236 to your computer and use it in GitHub Desktop.
html to json using html2json.com api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# by m4ll0k | |
# github.com/m4ll0k | |
# gist.github.com/m4ll0k | |
# Usage: | |
#------ python3 tojson.py https://www.example.com | |
#------ cat targets.txt | python3 tojson.py | |
import requests as _0x1 | |
import sys as _0x2 | |
import json as _0x9 | |
def _0x0000(url:str)-> None: | |
try: | |
_0x3={}['0x636f6e74656e74']=_0x1.get(url) | |
_0x4={}['0x6a736f6e']=_0x1.post( | |
'https://html2json.com/api/v1', | |
data=str(_0x3.content).encode('utf-8') | |
) | |
print(_0x4.content.decode('utf-8')) | |
except Exception as _0x5: | |
_0x2.exit(print( | |
_0x5 | |
)) | |
try: | |
if len(_0x2.argv) > 1: | |
_0x0000(_0x2.argv[1]) | |
else: | |
for _0x5 in [_0x7.strip() for _0x7 in _0x2.stdin]: | |
_0x0000(_0x5) | |
except Exception as _0x5: | |
_0x2.exit(print( | |
_0x5 | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment