[ale] Using Perl to Access Linksys

Fletch fletch at phydeaux.org
Mon Jan 20 10:19:26 EST 2003


>>>>> "Armsby" == Armsby John-G <Armsby> writes:


[...]

    Armsby> I have no problem "getting" any html page and putting it
    Armsby> in a variable.  Unfortunately the html login prompt is not
    Armsby> captured, it is not an html "page".


        If it's returning AUTH_REQUIRED, you can use LWP to grab it
but you'll need to use LWP::UserAgent and build a request object
yourself rather than just LWP::Simple (which is what I'm presuming
you're using).  See `perldoc lwpcook' and look for the section
entitled `ACCESS TO PROTECTED DOCUMENTS' for an example.


        If it's a login form rather than HTTP authorisation you'll
need to grab the form, determine the parameters it's expecting, and
then pass them with the request.


        And you may want to check out _Perl and LWP_ from ORA (ISBN
0596001789) which covers the LWP modules as well as several different
methods for `screenscraping' from HTML documents (regexen for simple
simple stuff, HTML::TokeParser and HTML::TreeBuilder for more
complicated tasks).


        Not to mention the TMTOWTDI solution of seeing if the router
supports SNMP and trying to snag whatever that way.


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list