skip to Main Content

Json – Connecting to an API and parsing the data

import requests import json def jprint(obj): text = json.dumps(obj, sort_keys=True, indent=4) if name == "main": response = requests.get("https://anapioficeandfire.com/api/characters/583") jprint(response.json()) data_list = response.json() my_dictionary = data_list[0] tvSeries = int(input("What series do you want to search?")) final_dictionary = {} for elem in…

VIEW QUESTION

Postgresql – Problem with databe "TypeError: <generator object get_db at 0x000002B68FBDB100> is not a callable object"

I get File "C:PythonProjectsmyProjectroutershome.py", line 39, in @router.get("/home", response_class=HTMLResponse) ... raise TypeError('{!r} is not a callable object'.format(obj)) TypeError: <generator object get_db at 0x000002B68FBDB100> is not a callable object home.py from fastapi import Depends, APIRouter, Request from fastapi.templating import Jinja2Templates from…

VIEW QUESTION

Html – extract value from span

I want to extract a snow depth value from a weather site to a dataframe. (https://www.yr.no/nb/sn%C3%B8dybder/NO-46/Norge/Vestland) Specifically the snow depth for the Jordalen - NĂ¥sen area. Screen shot The closest I've gotten is printing all the values using this code:…

VIEW QUESTION
Back To Top
Search