Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Automatically fill out web forms from the command line

by MistaMuShu (Beadle)
on Dec 21, 2004 at 21:57 UTC ( [id://416632]=note: print w/replies, xml ) Need Help??


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

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?
  • Comment on Re^2: Automatically fill out web forms from the command line

Replies are listed 'Best First'.
Re^3: How to authenticate / login htaccess with WWW::Mechanize
by davido (Cardinal) on Dec 21, 2004 at 22:23 UTC

    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

Re^3: Automatically fill out web forms from the command line
by kutsu (Priest) on Dec 21, 2004 at 22:05 UTC

    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://416632]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found