Try this:
import json
import requests
with requests.Session() as s:
r1 = s.post(
'https://www.zevercloud.com/login',
data=dict(username='[email protected]', password='Password123'),
)
r2 = s.get('https://www.zevercloud.com/data/energy/amountm/2021-01?sid=62923').json()
print(json.dumps(r2, indent=4))
Output:
[
{
"isno": null,
"sid": 62923,
"byname": "Generation",
"qdate": "2021-01",
"unit": "kWh",
"dataset": [
{
"time": "2021-01-01",
"value": [
"2.2"
],
"consump": 0.0,
"mexport": 0.0,
"mimport": 0.0,
"net": 0.0
},
{
"time": "2021-01-02",
"value": [
"1.8"
],
"consump": 0.0,
"mexport": 0.0,
"mimport": 0.0,
"net": 0.0
},
{
"time": "2021-01-03",
"value": [
"2.4"
],
"consump": 0.0,
"mexport": 0.0,
"mimport": 0.0,
"net": 0.0
},
and so on ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…