I am trying to use Jsoup to connect to developers.amazon.com.
Here is my code:
Map<String, String> get_All_InputFields(Document loginPage)
{
Map<String, String> inputFieldMap = new HashMap<String, String>();
Elements inputElements = loginPage.getElementsByTag("input");
for(Element e : inputElements)
{
if(!e.attr("name").isEmpty())
inputFieldMap.put(e.attr("name"), e.attr("value"));
}
return inputFieldMap;
}
String url_logon_str = "https://developer.amazon.com/home.html";
Connection.Response login_response = Jsoup.connect(url_logon_str).method.(Connection.Method.GET).execute();
Document loginPage = login_response.parse();
Map<String , String> inputFieldMap = get_All_InputFields(loginPage);
I am not able to logon. When I checked the Form data that gets posted, There is this input field by name metadata1 that I need to send when doing post.
But, the metadata1 is not present in inputFieldMap variable?
Am I doing anything wrong?