Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Or you could use <a href="https://metacpan.org/module/WWW::Mechanize" rel="nofollow noreferrer">WWW::Mechanize</a>. It builds upon <code>LWP</code> (which <code>LWP::Simple</code> is a very <em>simple</em> subset of) and provides lots of handy 'browser-like' behavior. For example, the typical session management of ASP-generated websites with login cookies and stuff gets handled by Mechanize automatically.</p> <pre><code>use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize-&gt;new; $mech-&gt;get( 'http:://www.example.org/login.asp' ); $mech-&gt;submit_form( form_number =&gt; 3, fields =&gt; { username =&gt; 'test', password =&gt; 'secret', } ); </code></pre> <p>While this first of all is good for testing, it still has LWPs inherited methods and you can access the plain request. You can thus access the request as well, while still having the power of the built-in parser to access forms and links.</p> <p>Also consider using a proper HTML parser, even if the website's output is no very fancy. There are several of these around that can handle it. It will be a lot easier than just building up <a href="https://stackoverflow.com/a/1732454/1331451">a bunch of regexes</a>. These will get hard to maintain once you need to go back because the page has changed something.</p> <p>Here's a list of related questions that have info on this subject:</p> <ul> <li><a href="https://stackoverflow.com/questions/7319756/parse-html-using-perl">Parse html using Perl</a></li> <li><a href="https://stackoverflow.com/questions/6774223/parse-html-using-perl">Parse html using Perl</a></li> <li><a href="https://stackoverflow.com/questions/6543708/perl-parse-links-from-html-table">Perl parse links from HTML Table</a></li> <li><a href="https://stackoverflow.com/questions/5033993/what-are-some-good-ways-to-parse-html-and-css-in-perl">What are some good ways to parse HTML and CSS in Perl?</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload