Drive an Applet without using robot class ?

Discussion in 'Java' started by prak, Jun 2, 2004.

  1. prak

    prak Guest

    Hi, Is there a way to drive an applet from a different url and scrape
    data from it without using the java.awt.robot class? Basically what I
    am looking for is to get the content out of an applet (screen
    scraping). I am using java.awt.robot class, but it will take control
    of your mouse and keyboard so we will not be able to runmultiple
    requests at the same time. This is a third-party applet we want to
    grab the content from. So we don't have control over that applet, but
    need to get the content out of it when it executes. Any help
    appreciated.
     
    prak, Jun 2, 2004
    #1
    1. Advertising

  2. Andrew Thompson, Jun 2, 2004
    #2
    1. Advertising

  3. prak

    prak Guest

    Andrew Thompson <> wrote in message news:<7n57ccqmxeyh$.15nh2e9anqztu$>...
    > On 2 Jun 2004 10:39:42 -0700, prak wrote:
    >
    > > Hi, Is there a way to drive an applet from a different url..

    >
    > What URL?


    Let's say for example I have this html
    http://java.sun.com/docs/books/tutorial/getStarted/index.html which
    includes applet in it. Let's assume that this applet prints some data
    like "hello world".
    Now I write my own code to parse this html file and grab applet and
    get to the content which is "html world". I can't use browser, I
    should get to this content through the code may be like a String or
    something. Any ideas ?
     
    prak, Jun 2, 2004
    #3
  4. prak

    Guest

    Peace be unto you.
    Maybe this example is extremely basic for your problem,
    but here is a guess anyway.

    I visited
    http://java.sun.com/docs/books/tutorial/applet/overview/lifeCycle.html

    I looked for Simple.class in the HTML document
    <applet code="Simple.class" codebase=example-1dot1/ width=500 height=20>

    I downloaded the class
    http://java.sun.com/docs/books/tutorial/applet/overview/example-1dot1/Simple.class

    I inspected it
    C:\WINDOWS\Desktop>javap Simple
    Compiled from "Simple.java"
    public class Simple extends java.applet.Applet{
    java.lang.StringBuffer buffer;
    public void init();
    public void start();
    public void stop();
    public void destroy();
    void addItem(java.lang.String);
    public void paint(java.awt.Graphics);
    public Simple();
    }

    I wrote a companion class
    class RunApplet
    {
    public static void main(String [] s)
    {
    Simple app = new Simple();
    app.init();
    app.start();
    System.out.println("The text : " + app.buffer);
    }
    }


    Output
    >java RunApplet

    initializing...
    starting...
    The text : initializing... starting...
    >Exit code: 0


    Have a Good Day.
     
    , Jun 3, 2004
    #4
  5. On 2 Jun 2004 14:10:40 -0700, prak wrote:
    > Andrew Thompson <> wrote in message news:
    >> On 2 Jun 2004 10:39:42 -0700, prak wrote:
    >>
    >>> Hi, Is there a way to drive an applet from a different url..

    >>
    >> What URL?

    >
    > Let's say for example I have this html ..


    Let's say for example you answer the question
    asked, what it is the URL where the applet resides?
    Until we know that, it is all just guesses.

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 3, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,249
    Scott M.
    Jan 17, 2010
  2. mh
    Replies:
    4
    Views:
    718
    Wolfgang Strobl
    May 31, 2005
  3. Tom Anderson
    Replies:
    8
    Views:
    403
    Gerrit Holl
    Sep 15, 2005
  4. Mike Joyce
    Replies:
    3
    Views:
    3,153
    Gordon Rainsford
    May 3, 2006
  5. shailesh
    Replies:
    1
    Views:
    813
    Tim Golden
    Mar 28, 2007
Loading...

Share This Page