tridib.bolar has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I call Java applet using Perl script
by Anonymous Monk on Dec 19, 2008 at 01:15 UTC | |
by tridib.bolar (Initiate) on Dec 20, 2008 at 23:42 UTC | |
|
Re: How can I call Java applet using Perl script
by imrags (Monk) on Dec 19, 2008 at 05:23 UTC | |
by Anonymous Monk on Dec 19, 2008 at 05:44 UTC | |
by tridib.bolar (Initiate) on Dec 20, 2008 at 23:39 UTC |