Last active
July 31, 2022 20:15
-
-
Save thisiskeanyvy/6c46dc623c2528dae6314e17c2d48489 to your computer and use it in GitHub Desktop.
Un script pour se connecter à l'ent via une requête POST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
# remove ssl certificate | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
# ent login | |
username="" | |
password="" | |
def auth(): | |
url = 'https://ent.iledefrance.fr/auth/login' | |
login_data = {'email': username, 'password': password} | |
try: | |
connect = requests.Session() | |
connect.post(url, verify=False, data=login_data) | |
get_data = connect.get(url) | |
except: | |
print("Request cannot be send...") | |
if "Authentification" not in str(get_data.content): | |
print("Connected") | |
elif "Authentification" in str(get_data.content): | |
print("Not Connected") | |
else: | |
print("Error please retry...") | |
if __name__ == "__main__": | |
auth() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment