so I'm wondering if there's anyway I can make a more suitable code for printing a certain type of value from a json file.
Code:
try:
import requests
from bs4 import BeautifulSoup as bs
import os
except ImportError as ex:
input(f"Module {ex.name} not installed, to install run '{'python' if os.name == 'nt' else 'python3.8'} -m pip install {ex.name}'\nPress enter to exit")
exit()
def main():
os.system('cls' if os.name == 'nt' else 'clear')
print ("Input the userID below!")
userID =str(input('~ '))
os.system('cls' if os.name == 'nt' else 'clear')
URL = "https://verify.eryn.io/api/user/"+userID
req = requests.get(URL)
soup = bs(req.text, 'html.parser')
print(soup)
os.system("pause")
main()
main()
Output(s):
{
"status": "ok",
"robloxUsername": "USERNAME%20HERE",
"robloxId": USER%20ID%20HERE
}
I'm wondering how can I print the status username and id.