So i'm working on a small project using an arduino to open the door to my apartment complex, which is done through their website. My plan is to have a button connected to my arduino (Which will have other functions aswell) which launches a python script to access the website. So far i have managed to log in to the website, but when trying to access the aptus portal site for opening the door i'm getting errors. This is the code i'm using, not sure that i'm doing it right (Kinda new to web interactions using scripts)
#!python 3
import requests
# Fill in your details here to be posted to the login form.
payload = {
'log': 'my_login',
'pwd': 'my_password'
}
open = {
'GridViewDoors$ctl06$btnOpen': 'öppna'
}
# Use 'with' to ensure the session context is closed after use.
with requests.Session() as s:
p = s.post('http://ift.tt/2jK4MPU', data=payload)
#Login to the main page
#Trying to access the aptus portal
r = s.post('http://ift.tt/2jEHDmY 10:23:26&hash=evXT1tp3FKWP2n0eycg7CwQJ8mk*', data=open)
print(r.text)
Aucun commentaire:
Enregistrer un commentaire