Prev: FAQ 4.22 How do I expand function calls in a string?
Next: FAQ 2.4 I copied the perl binary from one machine to another, but scripts don't work.
From: Tad McClellan on 13 Feb 2010 18:15 pastrufazio(a)gmail.com <pastrufazio(a)gmail.com> wrote: > Il Sat, 13 Feb 2010 15:51:49 -0600, Tad McClellan ha scritto: > >> Your program included use of the CGI module, sure you DO own the page >> that submits a form to the program you posted? >> > I will write a perl script doing the work. So: the script is on my pc, > the website involved in the login is on Internet. Errr, so why did your code use the CGI module then? That module is not very useful if your program is not running in the CGI environment... -- Tad McClellan email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
From: pastrufazio on 13 Feb 2010 18:30 Il Sat, 13 Feb 2010 17:15:25 -0600, Tad McClellan ha scritto: > Errr, so why did your code use the CGI module then? > > That module is not very useful if your program is not running in the CGI > environment... argh! so I'm not using the proper module, right!? sorry, but I'm really new with Perl! so, what can I use in a simple script tologin automatially to a website and retrieve a file?
From: C.DeRykus on 13 Feb 2010 20:27 On Feb 13, 3:30 pm, pastrufa...(a)gmail.com wrote: > Il Sat, 13 Feb 2010 17:15:25 -0600, Tad McClellan ha scritto: > > > Errr, so why did your code use the CGI module then? > > > That module is not very useful if your program is not running in the CGI > > environment... > > argh! so I'm not using the proper module, right!? > > sorry, but I'm really new with Perl! so, what can I use in a simple > script tologin automatially to a website and retrieve a file? If the website requires basic authorization, see the lwp cookbook example in section "Access to Protected Documents": http://search.cpan.org/~gaas/libwww-perl-5.834/lwpcook.pod -- Charles DeRykus
From: Tad McClellan on 13 Feb 2010 21:45 pastrufazio(a)gmail.com <pastrufazio(a)gmail.com> wrote: > Il Sat, 13 Feb 2010 17:15:25 -0600, Tad McClellan ha scritto: > >> Errr, so why did your code use the CGI module then? >> >> That module is not very useful if your program is not running in the CGI >> environment... > > argh! so I'm not using the proper module, right!? ^^^ ^^^ ? You are using 2 modules. One of them is the right thing for mechanizing access to web pages, and one of them is the right thing for programs that run in the CGI environment. You do not need CGI.pm if you are not in a CGI environment. > sorry, but I'm really new with Perl! so, what can I use in a simple > script tologin automatially to a website and retrieve a file? WWW::Mechanize. -- Tad McClellan email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
From: Mart van de Wege on 14 Feb 2010 06:27
pastrufazio(a)gmail.com writes: > >> Does that mean that you _will_ get [a WWW::Mechanize script] working >> from the command line first? > > Yes, and precisely _only_ from the command line! (I will insert an enty > in my crontab scheduling the script) > Side note: In my day job I manage a bunch of appliances for customers. These things are only accessible through their Web-UI. In order to do backups, I wrote a WWW::Mechanize script to log in, post the backup request form and save the response (a backup of the config file). The best way I found to test my automated login and post sequences was manually running the necessary methods from the Zoidberg shell. Try downloading and installing Zoidberg, and you can easily test all sorts of constructs before writing them up in a script. Regards, Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source. |