Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- user = {'profileusername':"<username>", 'profilepassword': "<password>"}
- login = requests.post('https://www.myeskom.co.za/profile/login', data=user)
- account_json = json.loads(login.text)
- success = 'data' in account_json
- if success == 0:
- print account_json['message']
- exit()
- payload = {'authKey':account_json['data']}
- page = requests.post('https://www.myeskom.co.za/pages/Dashboard/24', data=payload)
- json_decoded = json.loads(page.text)
- print json_decoded['data']['page']['region']
- print json_decoded['data']['page']['status']
- print json_decoded['data']['page']['tmp']
- for appl in json_decoded['data']['page']['appliances']:
- print appl['name']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement