Answer the question
In order to leave comments, you need to log in
How to add JSON for regular HTMl page?
Good afternoon!
I have a static Html page to which I need to connect Json so that when accessing it via requests.get
I could get an array of Json
Please help
me import urequests as requests
import json
response = requests.get("site")
Variable = json.loads(response.text)
Answer the question
In order to leave comments, you need to log in
1. You can't run python directly from html/js.
2. You can use js ( xmlhttprequest )
3. If it's important to use python, you can use a server written in python:
3.A: A simple self-written server (google for help).
3.B: Use the ready library:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question