Hello, I've to connect to a page that needs authentication.
How can I get the cookie after authentication and how can I pass the cookie to retrieve a page that needs authentication?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You should be able to access all you need through the org.htmlparser.http.ConnectionManager class. It is available on the parser as getConnectionManager().
For example:
parser.getConnectionManager ().setRedirectionProcessingEnabled (true);
parser.getConnectionManager ().setCookieProcessingEnabled (true);
To set a cookie, you could use:
setCookie (Cookie cookie, String domain)
Check other methods on this class too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I've to connect to a page that needs authentication.
How can I get the cookie after authentication and how can I pass the cookie to retrieve a page that needs authentication?
You should be able to access all you need through the org.htmlparser.http.ConnectionManager class. It is available on the parser as getConnectionManager().
For example:
parser.getConnectionManager ().setRedirectionProcessingEnabled (true);
parser.getConnectionManager ().setCookieProcessingEnabled (true);
To set a cookie, you could use:
setCookie (Cookie cookie, String domain)
Check other methods on this class too.