我对python非常陌生,试图通过JSON数据进行解析
import requests
import json
URL = "http://myip/cgi-bin/lun/luci/;stok=/login?form=login"
payload = {
'operation': 'login',
'username': 'someuser',
'password': 'somepassword'
}
session = requests.session()
r = requests.post(URL, data=payload)
print (r.json())
我得到的回报是:
{u'data': {u'stok': u'0c2f16c954cd2cafccfaf1bf50000ac6'}, u'success': True}
我需要使用单引号0c2f16c954cd2cafccfaf1bf50000ac6
中的随机字母/数字集合(每次都会更改)。我没有看到任何双引号在这个答复。有几个问题:
它是JSON
r.json()
反序列化了对Pythondict
的JSON响应,然后print
打印出dict
相关问题 更多 >
编程相关推荐