What method of requests authentication do i need please? Is it dependant on the website?
I'm trying to get data on the current temperature etc of one of my kilns. The controller sends the information to a web server and can be accessed online. There is no api for the controller. The data appears in the source code for the website but i can't log in using "requests". I am not sure which authentication to use, or how to see what authentication the web site needs (very new at this type of thing). Once I can get the source code, i can extract the data that i need from the text and save into variables - happy with that side of things.
The username and password are real as its only reading data (not my usual password - honest).
This is what I have to get the source code. Any assistance to a python beginner would be great thanks.
Normal log in is here https://theplant.herokuapp.com/kiln_controllers/
- Code: Select all
import requests
from requests.auth import HTTPBasicAuth
r = requests.get('https://theplant.herokuapp.com/kiln_controllers/3720', auth=HTTPBasicAuth('mat@planware.co.uk' , '123456789012'))
print(r)
print(r.content)