Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Automatically fill out web forms from the command line

by kutsu (Priest)
on Dec 21, 2004 at 21:03 UTC ( [id://416617]=note: print w/replies, xml ) Need Help??


in reply to Automatically fill out web forms from the command line

Have a look at WWW::Mechanize it should do what you want.

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

  • Comment on Re: Automatically fill out web forms from the command line

Replies are listed 'Best First'.
Re^2: Automatically fill out web forms from the command line
by MistaMuShu (Beadle) on Dec 21, 2004 at 21:57 UTC
    I just realized I can't get started because the first page is a Apache authenication/authorization page. I tried looking through Apache::Access for help, but I'm not sure this is the right track?

      I posted about this a few weeks ago and bart helped me to find the answer. Here's an example snippet of how to authenticate an htaccess system with WWW::Mechanize:

      use strict; use warnings; use WWW::Mechanize; my $agent = WWW::Mechanize->new( autocheck => 1 ); $agent->credentials( 'www.somesite.com:80', 'somerealm', 'user', 'password' ); $agent->get( 'http://www.somesite.com/index.html' ); print $agent->content();

      It's important to use the port number in the credentials URL. The realm is also important to get right. You can usually see it as the title of the dialog box that pops up in your browser when you visit an htaccess-restricted site.


      Dave

      If your set up through a proxy server you should be able to use $mech->proxy(['http'], 'http://user:pass@host:port/'); (port usually being 8080), which is documented in WWW::Mechanize POD. If not, I'm not sure and hopefully some other, wiser, monk will help you out.

      "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://416617]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-24 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found