Tutorial by Examples

A simple POST request with authentication data is demonstrated below, note that the username and password field will vary depending on the website: final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"; ...
Most websites require a much more complicated process than the one demonstrated above. Common steps for logging into a website are: Get the unique cookie from the initial login form. Inspect the login form to see what the destination url is for the authentication request Parse the login form t...
In this example, we will log into the GitHub website by using the FormElement class. // # Constants used in this example final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"; final String LOGIN_FORM_U...

Page 1 of 1