skip to Main Content

Json – Fetching the value from the key in Python's dict

I am fetching 'value' from 'key' in JSON but I do not know why I cannot fetch the target information. Code below import json import requests #Person's ID id=1194452 #Url info=requests.get(f'https://api.brokercheck.finra.org/search/individual/{id}?hl=true&includePrevious=true&sort=bc_lastname_sort+asc,bc_firstname_sort+asc,bc_middlename_sort+asc,score+desc&wt=json') #convert to JSON x=info.json() #Value print(x["firstName"]) The following is…

VIEW QUESTION

Json – How to parse <script> tag using beautifulsoup

I am trying to read the window.appCache from a glassdoor reviews site. url = "https://www.glassdoor.com/Reviews/Alteryx-Reviews-E351220.htm" html = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'}) soup = BeautifulSoup(html.content,'html.parser') text = soup.findAll("script")[0].text This isolates the dict I need however when I tried to do json.loads() I…

VIEW QUESTION
Back To Top
Search