I want to create a program in java that gets all the images from a website that requires login information using a web crawler. I know this is possible using the image crawler example in crawler4J: https://github.com/yasserg/crawler4j/tree/master/crawler4j-examples/crawler4j-examples-base/src/test/java/edu/uci/ics/crawler4j/examples/imagecrawler. But i dont know how to configure it so that it uses my credentials to login in the page. I've already tried using:
String formUsername = "myUsername";
String formPassword = "myPassword";
String urlLogin = "myWebsite.xxx";
String session_user = "Login";
String session_password = "Password";
AuthInfo authInfo = new FormAuthInfo(formUsername, formPassword, urlLogin, session_user, session_password );
config.addAuthInfo(authInfo);
However this doesn't seem to work. I could really use some help in this. Thank you