Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 perusing the Monastery: (2)
As of 2024-06-22 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.