Created
August 6, 2020 00:34
-
-
Save alik604/d9cb1220b674627922cf00f8f4bfa7b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import urllib.parse as parse | |
url = "" | |
if 'url' not in globals(): | |
print("Enter URL to parse") | |
url = input() | |
def printDict(data): | |
for x in data: | |
print(x) | |
for y in data[x]: | |
print('\t', y) | |
parsed = parse.urlparse(url) | |
parsed = parse.parse_qs(parsed.query) | |
printDict(parsed) | |
# print(parsed['q']) | |
import json | |
print(json.dumps(parsed, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment