Hi Monks,

Hope you are all fine :).

I have one unusual requirement for my current project. I need to call a Java applet using Perl script and unfortunately I am new in Perl programming. My detail requirement is given below?

My requirement is, I need to write a script which can automatically log into my website and from there it should crawl into a particular link, which will help to open an applet, and the script should be able to click on some button on the applet to get some response from the applet. I have to write a script to automate this whole task. Currently I can able to log into the website using LWP::UserAgent, but after that I am not able to understand how to crawl into the destination link and how to open the applet. I have come to know from google that there is the LinkExtor class in perl to crawl into the different link, but I am not able to use the same. I am sending my auto login code for your ease. If there is any possible solution please let me know.

Thanks in advance.

use HTTP::Request::Common;

use LWP::UserAgent;

use HTML::LinkExtor;

$URL='http://<my_server>:<my_port>/<my_path>/login.jsp';

$browser = LWP::UserAgent->new();

$browser->timeout(1000);

$response = $browser->post($URL, [ UserId => ‘user_id’, Password => 'password' ] );

if ($response->is_error()){printf "%s\n", $response->status_line;}

$contents=$response->content();

print $response->as_string;;

print $contents;

Thanks

-Tridib


In reply to How can I call Java applet using Perl script by tridib.bolar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.