I am trying to see if it is all possible to login to a website after which I will make calls to extract some data. I am doing the latter from one website which doesn't require a login as so:
doc = Jsoup.connect("https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs").data("retrieveLocId", params[0])
.data("formatType", "ICAO").data("reportType", "RAW").data("actionType", "notamRetrievalByICAOs")
// .userAgent("Mozilla")
// .cookie("auth", "token")
.timeout(6000).post();
This is working perfectly so I want to do the same thing on this other website but I need to login first.
So I have stripped the webpage down to the barest amount to try and see what is required to make the login work and I have the following:
<script src="https://www.airservicesaustralia.com/naips/Scripts/2012.1.214/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="https://www.airservicesaustralia.com/naips/Scripts/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
<form action="https://www.airservicesaustralia.com/naips/Account/LogOn" id="frmLogon" method="post">
<input name="UserName" value="login_goes_here" />
<input name="Password" value="password_goes_here"/>
<input type="hidden" value="Submit" data-type="submit" />
</form>
<script src="https://www.airservicesaustralia.com/naips/Scripts/napis/naips.js?v0.0076" type="text/javascript"></script>
If I press the submit button now the login succeeds. However, I have now run out of knowledge about how this whole thing works in terms of the scripts. So my question at this stage is, is it even possible to construct a call from within Android to get a successful login such that I can then use the same style of jsoup.connect I am currently using?
I am thinking I have to look at the naips.js script and perhaps find out what it is finally using to submit but I'm not sure. Any help would be appreciated.
Gavin...