Hi all master

is posible srcape a web java applet using curl php?
please help

An applet does not return readable HTML the way a regular page does. So no, I don't think it's possible.

no other solution?

don't expect to get other solution. It can be done, but it will be out of the ordinary. My answer is no and no :).

Why not? Because java applets are delivered between <applet></applet> tags. There is no way to parse the linked applet class.

<html>
<body>
<applet code="someJavaAppletClass.class"></applet>
</body>
</html>

The problem is that even if we follow the code attributes, the cURL will ended up downloading it, but will not be able to parse whatever the class output.

Even if we donwloaded the applet and convert it to some text file that can be read by PHP, it will be very difficult to guess the class output.

Take this simple lifted snippet from a working applet. This is just a part of the script just to give you the clear insight of what is going in the applet..

  private Image thisImage;
  private AppletContext context;
  public void init()
  {
      context = this.getAppletContext();
      String thisImageURL = this.getParameter("thisImage");
      if(thisImageURL == null)
      {
         thisImageURL = "test.jpg";
      }

We can matched the curly bracket, but thisImageURL will be difficult to capture. Unless, we use the line breaks BUT I honestly will not go and explore that possibilities. It is tidious process just to be able to parse the location of the test.jpg.

Good luck to you..and thank you for visiting Daniweb.

Thank you for the explaination

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.