taking a look at some examples of web automation scripts

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'd like to take a look at examples of web automation that anyone might
have.  I found this one today and was able to adapt it (slightly) to
actually make it work.  I think of how long it takes me to do this with
GUI events, and this is so much better.

$ ./cpan1.pl HTML::Form
$ cat cpan1.pl

# turn on perl's safety features
use strict;
use warnings;

# work out the name of the module we're looking for
my $module_name = $ARGV[0]
or die "Must specify module name on command line";

# create a new browser
use WWW::Mechanize;
my $browser = WWW::Mechanize->new();

# tell it to get the main page

# okay, fill in the box with the name of the
# module we want to look up
$browser->field( "query", $module_name );

# click on the link that matches the module name
$browser->follow_link( text => $module_name );

my $url = $browser->uri;

# launch a browser...
system( 'firefox', $url );


That this fires up firefox at the end makes it a great tool.  I'm
struggling now with the referencing in the object model, but I'm wearing
it down with repetition.

I'd love to see any examples others may have.

Re: taking a look at some examples of web automation scripts

On 02/02/2013 12:16 AM, Cal Dershowitz wrote:
Quoted text here. Click to load it

No responses. I think I need to change my toolchain.

Site Timeline