Hi,
as said, install the two modules mentined above. Then do perl -MWWW::Mechanize::Shell -eshell
You will end up in that shell. Type help for help, then e.g. type connect http://bla.bla to connect to that URL.
Make your way through the pages (it's a bit like using a text browser). Remember: help is at hand
When you have what you wanted to do, type script myscript
After quitting the shell (the Mechanize-Shell), you find a file called myscript in your directory that contains the code that will do exactly what you did in the shell.
This page should help you.
update: passing Apache Basic Auth. creditial with WWW::Mechanize? has some information on the auth part of your problem
Regards, svenXY | [reply] [d/l] [select] |
I would suggest that you should try simple LWP first and if you realize that the authentication is complex (more than just setting user and password in the standard brower user/password window) to use WWW::Mechanize.
Your code should look like this:
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->proxy('https', 'ftp', 'http://proxy.sn.no:8001/');
$ua->credentials(
'servername:portnumber',
'realm-name',
'username' => 'password'
);
Have a look at http://lwp.interglacial.com/ch11_03.htm.
If you use Windows, then you may also have issues with the SSL module as it is not always included in the distribution.
| [reply] |