Get page's html source using a Java applet
<p>I know in scripting languages like Python that this is possible but I know that Java applets can't access other servers other than their own.</p>

<p>I don't know/think I can get this applet signed. Is there a way to use PHP to do what I want to accomplish?</p>

<p>I also know that this code will go to google.com</p>

<pre><code>import java.applet.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;

public class tesURL extends Applet implements ActionListener{

  public void init(){
  String link_Text = "google";
  Button b = new Button(link_Text);
  b.addActionListener(this);
  add(b);
  }

  public void actionPerformed(ActionEvent ae){
  //get the button label
  Button source = (Button)ae.getSource();

  String link = "http://www."+source.getLabel()+".com";
  try
  {
  AppletContext a = getAppletContext();
  URL u = new URL(link);
//  a.showDocument(u,"_blank");
//  _blank to open page in new window  
  a.showDocument(u,"_self");
  }
  catch (MalformedURLException e){
  System.out.println(e.getMessage());
  }
  }
}
</code></pre>

<p>That is assuming that source.getLabel() is "google"</p>

<p>But how would I get the source html of that page?</p>

<p>The source html is dynamic and is updated every few seconds or miliseconds. But, the html is also updated, so I can still read the dynamic content directly from the html. I already did this in vb.net, but now I need to port it to Java, but I can't figure out how to access a page's html source; that's why I'm asking.</p>
