Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi I am trying to login to an outlook web application using python web crawler but I am not getting through the login page. From what I noticed the site will redirect upon the get request and set a cookie; namely OutlookSession. Then the post request goes to the same url having this cookie and this is the reason I am using requests.Session().
- This is my code:
- ```
- import requests
- URL = "https://mail.guc.edu.eg/owa"
- username = "username"
- password = "password"
- s = requests.Session()
- s.get(URL)
- login_data={"username":username, "password":password}
- r = s.post("https://mail.guc.edu.eg/owa", data=login_data)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement