0

Currently using Requests to try to log into https://mypay.dfas.mil/mypay.aspx. My problem is I don't know how to get the page this generates in a new tab upon login.

import requests
url = 'https://mypay.dfas.mil/mypay.aspx'
payload = {'visLogin': 'id', 'visPin': 'pass'}
r = requests.post(url, data=payload)
print(r.text)

This gives me the same page back because it opens a new tab. I just need to get past this part and everything else is generated in the same tab.

  • https://stackoverflow.com/questions/11892729/how-to-log-in-to-a-website-using-pythons-requests-module#17633072 ... My experience with requests is that it becomes complicated with .aspx sites and logins -- there is stuff you have to embed in all future requests for authentication and feedback. I'd recommend selenium personally. It isn't that hard to use. – SteveJ Feb 28 '18 at 16:14
  • https://stackoverflow.com/questions/48939089/how-can-i-get-past-a-password-protected-aspx-website-in-order-to-parse-it-progra/48939360#48939360 – SteveJ Feb 28 '18 at 16:20

0 Answers0