How to set options and click javascripted button on html page and get stream of next page
<p>I have a little problem i don't understand how to work with Java HttpURLConnection
I want to set options on html page than by pressing a button to get stream of next page i have here two examples of html pages
<a href="http://adamtech.somee.com/index.html" rel="nofollow">Page1</a>
and
<a href="http://adamtech.somee.com/site.html" rel="nofollow">Page2</a>
In the page 1 i need to choose "My Site" than press the button and than to stream text from the page2</p>

<p>This is my code i don't known what to do now </p>

<pre><code>public class Main {

/**
 * @param args
 */
public static void main(String[] args) {
    URL url;
    HttpURLConnection conn;
    try{
        url=new URL("My site here");
        conn=(HttpURLConnection)url.openConnection();
        InputStream stream = url.openStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        conn.setDoOutput(true);
        conn.setRequestMethod("PUT");

        }
        catch(MalformedURLException ex){  
        }
        // and some more
        catch(IOException ex){
        }

}

}
</code></pre>

<p>I need your help please !!!!
Thanks a lot !</p>
