0

I can find some jars like HTMLPARSER and java.net package to access the source of a URL

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class sample2 {
    public static void main(String args[]) throws Exception
    {

String data=null;
URL location = new URL("http://www.google.com");
URLConnection conn = location.openConnection();
BufferedReader in = new BufferedReader(
    new InputStreamReader(
    conn.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) 
    data += inputLine + "\n";
System.out.println(data);
in.close();
    }
}

How can we access source code of a web URL that can be accessed only if we have logged in? For example how to access my gmail inbox contents url from java?
How should i pass the login credentials?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by peter_budo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.