1WWW::Mechanize(3)     User Contributed Perl Documentation    WWW::Mechanize(3)
2
3
4

NAME

6       WWW::Mechanize - Handy web browsing in a Perl object
7

VERSION

9       version 2.00
10

SYNOPSIS

12       WWW::Mechanize supports performing a sequence of page fetches including
13       following links and submitting forms. Each fetched page is parsed and
14       its links and forms are extracted. A link or a form can be selected,
15       form fields can be filled and the next page can be fetched.  Mech also
16       stores a history of the URLs you've visited, which can be queried and
17       revisited.
18
19           use WWW::Mechanize ();
20           my $mech = WWW::Mechanize->new();
21
22           $mech->get( $url );
23
24           $mech->follow_link( n => 3 );
25           $mech->follow_link( text_regex => qr/download this/i );
26           $mech->follow_link( url => 'http://host.com/index.html' );
27
28           $mech->submit_form(
29               form_number => 3,
30               fields      => {
31                   username    => 'mungo',
32                   password    => 'lost-and-alone',
33               }
34           );
35
36           $mech->submit_form(
37               form_name => 'search',
38               fields    => { query  => 'pot of gold', },
39               button    => 'Search Now'
40           );
41
42           # Enable strict form processing to catch typos and non-existant form fields.
43           my $strict_mech = WWW::Mechanize->new( strict_forms => 1);
44
45           $strict_mech->get( $url );
46
47           # This method call will die, saving you lots of time looking for the bug.
48           $strict_mech->submit_form(
49               form_number => 3,
50               fields      => {
51                   usernaem     => 'mungo',           # typo in field name
52                   password     => 'lost-and-alone',
53                   extra_field  => 123,               # field does not exist
54               }
55           );
56

DESCRIPTION

58       "WWW::Mechanize", or Mech for short, is a Perl module for stateful
59       programmatic web browsing, used for automating interaction with
60       websites.
61
62       Features include:
63
64       ·   All HTTP methods
65
66       ·   High-level hyperlink and HTML form support, without having to parse
67           HTML yourself
68
69       ·   SSL support
70
71       ·   Automatic cookies
72
73       ·   Custom HTTP headers
74
75       ·   Automatic handling of redirections
76
77       ·   Proxies
78
79       ·   HTTP authentication
80
81       Mech is well suited for use in testing web applications.  If you use
82       one of the Test::*, like Test::HTML::Lint modules, you can check the
83       fetched content and use that as input to a test call.
84
85           use Test::More;
86           like( $mech->content(), qr/$expected/, "Got expected content" );
87
88       Each page fetch stores its URL in a history stack which you can
89       traverse.
90
91           $mech->back();
92
93       If you want finer control over your page fetching, you can use these
94       methods. "follow_link" and "submit_form" are just high level wrappers
95       around them.
96
97           $mech->find_link( n => $number );
98           $mech->form_number( $number );
99           $mech->form_name( $name );
100           $mech->field( $name, $value );
101           $mech->set_fields( %field_values );
102           $mech->set_visible( @criteria );
103           $mech->click( $button );
104
105       WWW::Mechanize is a proper subclass of LWP::UserAgent and you can also
106       use any of LWP::UserAgent's methods.
107
108           $mech->add_header($name => $value);
109
110       Please note that Mech does NOT support JavaScript, you need additional
111       software for that. Please check "JavaScript" in WWW::Mechanize::FAQ for
112       more.
113
115       ·   <https://github.com/libwww-perl/WWW-Mechanize/issues>
116
117           The queue for bugs & enhancements in WWW::Mechanize.  Please note
118           that the queue at <http://rt.cpan.org> is no longer maintained.
119
120       ·   <https://metacpan.org/pod/WWW::Mechanize>
121
122           The CPAN documentation page for Mechanize.
123
124       ·   <https://metacpan.org/pod/distribution/WWW-Mechanize/lib/WWW/Mechanize/FAQ.pod>
125
126           Frequently asked questions.  Make sure you read here FIRST.
127

CONSTRUCTOR AND STARTUP

129   new()
130       Creates and returns a new WWW::Mechanize object, hereafter referred to
131       as the "agent".
132
133           my $mech = WWW::Mechanize->new()
134
135       The constructor for WWW::Mechanize overrides two of the params to the
136       LWP::UserAgent constructor:
137
138           agent => 'WWW-Mechanize/#.##'
139           cookie_jar => {}    # an empty, memory-only HTTP::Cookies object
140
141       You can override these overrides by passing params to the constructor,
142       as in:
143
144           my $mech = WWW::Mechanize->new( agent => 'wonderbot 1.01' );
145
146       If you want none of the overhead of a cookie jar, or don't want your
147       bot accepting cookies, you have to explicitly disallow it, like so:
148
149           my $mech = WWW::Mechanize->new( cookie_jar => undef );
150
151       Here are the params that WWW::Mechanize recognizes.  These do not
152       include params that LWP::UserAgent recognizes.
153
154       ·   "autocheck => [0|1]"
155
156           Checks each request made to see if it was successful.  This saves
157           you the trouble of manually checking yourself.  Any errors found
158           are errors, not warnings.
159
160           The default value is ON, unless it's being subclassed, in which
161           case it is OFF.  This means that standalone WWW::Mechanize
162           instances have autocheck turned on, which is protective for the
163           vast majority of Mech users who don't bother checking the return
164           value of get() and post() and can't figure why their code fails.
165           However, if WWW::Mechanize is subclassed, such as for
166           Test::WWW::Mechanize or Test::WWW::Mechanize::Catalyst, this may
167           not be an appropriate default, so it's off.
168
169       ·   "noproxy => [0|1]"
170
171           Turn off the automatic call to the LWP::UserAgent "env_proxy"
172           function.
173
174           This needs to be explicitly turned off if you're using
175           Crypt::SSLeay to access a https site via a proxy server.  Note: you
176           still need to set your HTTPS_PROXY environment variable as
177           appropriate.
178
179       ·   "onwarn => \&func"
180
181           Reference to a "warn"-compatible function, such as "Carp::carp",
182           that is called when a warning needs to be shown.
183
184           If this is set to "undef", no warnings will ever be shown.
185           However, it's probably better to use the "quiet" method to control
186           that behavior.
187
188           If this value is not passed, Mech uses "Carp::carp" if Carp is
189           installed, or "CORE::warn" if not.
190
191       ·   "onerror => \&func"
192
193           Reference to a "die"-compatible function, such as "Carp::croak",
194           that is called when there's a fatal error.
195
196           If this is set to "undef", no errors will ever be shown.
197
198           If this value is not passed, Mech uses "Carp::croak" if Carp is
199           installed, or "CORE::die" if not.
200
201       ·   "quiet => [0|1]"
202
203           Don't complain on warnings.  Setting "quiet => 1" is the same as
204           calling "$mech->quiet(1)".  Default is off.
205
206       ·   "stack_depth => $value"
207
208           Sets the depth of the page stack that keeps track of all the
209           downloaded pages. Default is effectively infinite stack size.  If
210           the stack is eating up your memory, then set this to a smaller
211           number, say 5 or 10.  Setting this to zero means Mech will keep no
212           history.
213
214       In addition, WWW::Mechanize also allows you to globally enable strict
215       and verbose mode for form handling, which is done with HTML::Form.
216
217       ·   "strict_forms => [0|1]"
218
219           Globally sets the HTML::Form strict flag which causes form
220           submission to croak if any of the passed fields don't exist in the
221           form, and/or a value doesn't exist in a select element. This can
222           still be disabled in individual calls to "submit_form()".
223
224           Default is off.
225
226       ·   "verbose_forms => [0|1]"
227
228           Globally sets the HTML::Form verbose flag which causes form
229           submission to warn about any bad HTML form constructs found. This
230           cannot be disabled later.
231
232           Default is off.
233
234       ·   "marked_sections => [0|1]"
235
236           Globally sets the HTML::Parser marked sections flag which causes
237           HTML "CDATA[[" sections to be honoured. This cannot be disabled
238           later.
239
240           Default is on.
241
242       To support forms, WWW::Mechanize's constructor pushes POST on to the
243       agent's "requests_redirectable" list (see also LWP::UserAgent.)
244
245   $mech->agent_alias( $alias )
246       Sets the user agent string to the expanded version from a table of
247       actual user strings.  $alias can be one of the following:
248
249       ·   Windows IE 6
250
251       ·   Windows Mozilla
252
253       ·   Mac Safari
254
255       ·   Mac Mozilla
256
257       ·   Linux Mozilla
258
259       ·   Linux Konqueror
260
261       then it will be replaced with a more interesting one.  For instance,
262
263           $mech->agent_alias( 'Windows IE 6' );
264
265       sets your User-Agent to
266
267           Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
268
269       The list of valid aliases can be returned from "known_agent_aliases()".
270       The current list is:
271
272       ·   Windows IE 6
273
274       ·   Windows Mozilla
275
276       ·   Mac Safari
277
278       ·   Mac Mozilla
279
280       ·   Linux Mozilla
281
282       ·   Linux Konqueror
283
284   known_agent_aliases()
285       Returns a list of all the agent aliases that Mech knows about.
286

PAGE-FETCHING METHODS

288   $mech->get( $uri )
289       Given a URL/URI, fetches it.  Returns an HTTP::Response object.  $uri
290       can be a well-formed URL string, a URI object, or a
291       WWW::Mechanize::Link object.
292
293       The results are stored internally in the agent object, but you don't
294       know that.  Just use the accessors listed below.  Poking at the
295       internals is deprecated and subject to change in the future.
296
297       "get()" is a well-behaved overloaded version of the method in
298       LWP::UserAgent.  This lets you do things like
299
300           $mech->get( $uri, ':content_file' => $tempfile );
301
302       and you can rest assured that the params will get filtered down
303       appropriately.
304
305       NOTE: Because ":content_file" causes the page contents to be stored in
306       a file instead of the response object, some Mech functions that expect
307       it to be there won't work as expected. Use with caution.
308
309   $mech->post( $uri, content => $content )
310       POSTs $content to $uri.  Returns an HTTP::Response object.  $uri can be
311       a well-formed URI string, a URI object, or a WWW::Mechanize::Link
312       object.
313
314   $mech->put( $uri, content => $content )
315       PUTs $content to $uri.  Returns an HTTP::Response object.  $uri can be
316       a well-formed URI string, a URI object, or a WWW::Mechanize::Link
317       object.
318
319   $mech->reload()
320       Acts like the reload button in a browser: repeats the current request.
321       The history (as per the back() method) is not altered.
322
323       Returns the HTTP::Response object from the reload, or "undef" if
324       there's no current request.
325
326   $mech->back()
327       The equivalent of hitting the "back" button in a browser.  Returns to
328       the previous page.  Won't go back past the first page. (Really, what
329       would it do if it could?)
330
331       Returns true if it could go back, or false if not.
332
333   $mech->clear_history()
334       This deletes all the history entries and returns true.
335
336   $mech->history_count()
337       This returns the number of items in the browser history.  This number
338       does include the most recently made request.
339
340   $mech->history($n)
341       This returns the nth item in history.  The 0th item is the most recent
342       request and response, which would be acted on by methods like
343       "find_link()".  The 1th item is the state you'd return to if you called
344       "back()".
345
346       The maximum useful value for $n is "$mech->history_count - 1".
347       Requests beyond that bound will return "undef".
348
349       History items are returned as hash references, in the form:
350
351         { req => $http_request, res => $http_response }
352

STATUS METHODS

354   $mech->success()
355       Returns a boolean telling whether the last request was successful.  If
356       there hasn't been an operation yet, returns false.
357
358       This is a convenience function that wraps "$mech->res->is_success".
359
360   $mech->uri()
361       Returns the current URI as a URI object. This object stringifies to the
362       URI itself.
363
364   $mech->response() / $mech->res()
365       Return the current response as an HTTP::Response object.
366
367       Synonym for "$mech->response()"
368
369   $mech->status()
370       Returns the HTTP status code of the response.  This is a 3-digit number
371       like 200 for OK, 404 for not found, and so on.
372
373   $mech->ct() / $mech->content_type()
374       Returns the content type of the response.
375
376   $mech->base()
377       Returns the base URI for the current response
378
379   $mech->forms()
380       When called in a list context, returns a list of the forms found in the
381       last fetched page. In a scalar context, returns a reference to an array
382       with those forms. The forms returned are all HTML::Form objects.
383
384   $mech->current_form()
385       Returns the current form as an HTML::Form object.
386
387   $mech->links()
388       When called in a list context, returns a list of the links found in the
389       last fetched page.  In a scalar context it returns a reference to an
390       array with those links.  Each link is a WWW::Mechanize::Link object.
391
392   $mech->is_html()
393       Returns true/false on whether our content is HTML, according to the
394       HTTP headers.
395
396   $mech->title()
397       Returns the contents of the "<TITLE>" tag, as parsed by
398       HTML::HeadParser.  Returns undef if the content is not HTML.
399

CONTENT-HANDLING METHODS

401   $mech->content(...)
402       Returns the content that the mech uses internally for the last page
403       fetched. Ordinarily this is the same as
404       "$mech->response()->decoded_content()", but this may differ for HTML
405       documents if update_html is overloaded (in which case the value passed
406       to the base-class implementation of same will be returned), and/or
407       extra named arguments are passed to content():
408
409       $mech->content( format => 'text' )
410         Returns a text-only version of the page, with all HTML markup
411         stripped. This feature requires HTML::TreeBuilder version 5 or higher
412         to be installed, or a fatal error will be thrown. This works only if
413         the contents are HTML.
414
415       $mech->content( base_href => [$base_href|undef] )
416         Returns the HTML document, modified to contain a "<base
417         href="$base_href">" mark-up in the header.  $base_href is
418         "$mech->base()" if not specified. This is handy to pass the HTML to
419         e.g. HTML::Display. This works only if the contents are HTML.
420
421       $mech->content( raw => 1 )
422         Returns "$self->response()->content()", i.e. the raw contents from
423         the response.
424
425       $mech->content( decoded_by_headers => 1 )
426         Returns the content after applying all "Content-Encoding" headers but
427         with not additional mangling.
428
429       $mech->content( charset => $charset )
430         Returns "$self->response()->decoded_content(charset => $charset)"
431         (see HTTP::Response for details).
432
433       To preserve backwards compatibility, additional parameters will be
434       ignored unless none of "raw | decoded_by_headers | charset" is
435       specified and the text is HTML, in which case an error will be
436       triggered.
437
438   $mech->text()
439       Returns the text of the current HTML content.  If the content isn't
440       HTML, $mech will die.
441
442       The text is extracted by parsing the content, and then the extracted
443       text is cached, so don't worry about performance of calling this
444       repeatedly.
445
447   $mech->links()
448       Lists all the links on the current page.  Each link is a
449       WWW::Mechanize::Link object. In list context, returns a list of all
450       links.  In scalar context, returns an array reference of all links.
451
452   $mech->follow_link(...)
453       Follows a specified link on the page.  You specify the match to be
454       found using the same params that "find_link()" uses.
455
456       Here some examples:
457
458       ·   3rd link called "download"
459
460               $mech->follow_link( text => 'download', n => 3 );
461
462       ·   first link where the URL has "download" in it, regardless of case:
463
464               $mech->follow_link( url_regex => qr/download/i );
465
466           or
467
468               $mech->follow_link( url_regex => qr/(?i:download)/ );
469
470       ·   3rd link on the page
471
472               $mech->follow_link( n => 3 );
473
474       ·   the link with the url
475
476               $mech->follow_link( url => '/other/page' );
477
478           or
479
480               $mech->follow_link( url => 'http://example.com/page' );
481
482       Returns the result of the "GET" method (an HTTP::Response object) if a
483       link was found.
484
485       If the page has no links, or the specified link couldn't be found,
486       returns "undef".  If "autocheck" is enabled an exception will be thrown
487       instead.
488
489   $mech->find_link( ... )
490       Finds a link in the currently fetched page. It returns a
491       WWW::Mechanize::Link object which describes the link.  (You'll probably
492       be most interested in the "url()" property.)  If it fails to find a
493       link it returns undef.
494
495       You can take the URL part and pass it to the "get()" method.  If that's
496       your plan, you might as well use the "follow_link()" method directly,
497       since it does the "get()" for you automatically.
498
499       Note that "<FRAME SRC="...">" tags are parsed out of the the HTML and
500       treated as links so this method works with them.
501
502       You can select which link to find by passing in one or more of these
503       key/value pairs:
504
505       ·   "text => 'string'," and "text_regex => qr/regex/,"
506
507           "text" matches the text of the link against string, which must be
508           an exact match.  To select a link with text that is exactly
509           "download", use
510
511               $mech->find_link( text => 'download' );
512
513           "text_regex" matches the text of the link against regex.  To select
514           a link with text that has "download" anywhere in it, regardless of
515           case, use
516
517               $mech->find_link( text_regex => qr/download/i );
518
519           Note that the text extracted from the page's links are trimmed.
520           For example, "<a> foo </a>" is stored as 'foo', and searching for
521           leading or trailing spaces will fail.
522
523       ·   "url => 'string'," and "url_regex => qr/regex/,"
524
525           Matches the URL of the link against string or regex, as
526           appropriate.  The URL may be a relative URL, like foo/bar.html,
527           depending on how it's coded on the page.
528
529       ·   "url_abs => string" and "url_abs_regex => regex"
530
531           Matches the absolute URL of the link against string or regex, as
532           appropriate.  The URL will be an absolute URL, even if it's
533           relative in the page.
534
535       ·   "name => string" and "name_regex => regex"
536
537           Matches the name of the link against string or regex, as
538           appropriate.
539
540       ·   "id => string" and "id_regex => regex"
541
542           Matches the attribute 'id' of the link against string or regex, as
543           appropriate.
544
545       ·   "class => string" and "class_regex => regex"
546
547           Matches the attribute 'class' of the link against string or regex,
548           as appropriate.
549
550       ·   "tag => string" and "tag_regex => regex"
551
552           Matches the tag that the link came from against string or regex, as
553           appropriate.  The "tag_regex" is probably most useful to check for
554           more than one tag, as in:
555
556               $mech->find_link( tag_regex => qr/^(a|frame)$/ );
557
558           The tags and attributes looked at are defined below.
559
560       If "n" is not specified, it defaults to 1.  Therefore, if you don't
561       specify any params, this method defaults to finding the first link on
562       the page.
563
564       Note that you can specify multiple text or URL parameters, which will
565       be ANDed together.  For example, to find the first link with text of
566       "News" and with "cnn.com" in the URL, use:
567
568           $mech->find_link( text => 'News', url_regex => qr/cnn\.com/ );
569
570       The return value is a reference to an array containing a
571       WWW::Mechanize::Link object for every link in "$self->content".
572
573       The links come from the following:
574
575       "<a href=...>"
576       "<area href=...>"
577       "<frame src=...>"
578       "<iframe src=...>"
579       "<link href=...>"
580       "<meta content=...>"
581
582   $mech->find_all_links( ... )
583       Returns all the links on the current page that match the criteria.  The
584       method for specifying link criteria is the same as in "find_link()".
585       Each of the links returned is a WWW::Mechanize::Link object.
586
587       In list context, "find_all_links()" returns a list of the links.
588       Otherwise, it returns a reference to the list of links.
589
590       "find_all_links()" with no parameters returns all links in the page.
591
592   $mech->find_all_inputs( ... criteria ... )
593       find_all_inputs() returns an array of all the input controls in the
594       current form whose properties match all of the regexes passed in.  The
595       controls returned are all descended from HTML::Form::Input.  See
596       "INPUTS" in HTML::Form for details.
597
598       If no criteria are passed, all inputs will be returned.
599
600       If there is no current page, there is no form on the current page, or
601       there are no submit controls in the current form then the return will
602       be an empty array.
603
604       You may use a regex or a literal string:
605
606           # get all textarea controls whose names begin with "customer"
607           my @customer_text_inputs = $mech->find_all_inputs(
608               type       => 'textarea',
609               name_regex => qr/^customer/,
610           );
611
612           # get all text or textarea controls called "customer"
613           my @customer_text_inputs = $mech->find_all_inputs(
614               type_regex => qr/^(text|textarea)$/,
615               name       => 'customer',
616           );
617
618   $mech->find_all_submits( ... criteria ... )
619       "find_all_submits()" does the same thing as "find_all_inputs()" except
620       that it only returns controls that are submit controls, ignoring other
621       types of input controls like text and checkboxes.
622

IMAGE METHODS

624   $mech->images
625       Lists all the images on the current page.  Each image is a
626       WWW::Mechanize::Image object. In list context, returns a list of all
627       images.  In scalar context, returns an array reference of all images.
628
629   $mech->find_image()
630       Finds an image in the current page. It returns a WWW::Mechanize::Image
631       object which describes the image.  If it fails to find an image it
632       returns undef.
633
634       You can select which image to find by passing in one or more of these
635       key/value pairs:
636
637       ·   "alt => 'string'" and "alt_regex => qr/regex/"
638
639           "alt" matches the ALT attribute of the image against string, which
640           must be an exact match. To select a image with an ALT tag that is
641           exactly "download", use
642
643               $mech->find_image( alt => 'download' );
644
645           "alt_regex" matches the ALT attribute of the image  against a
646           regular expression.  To select an image with an ALT attribute that
647           has "download" anywhere in it, regardless of case, use
648
649               $mech->find_image( alt_regex => qr/download/i );
650
651       ·   "url => 'string'" and "url_regex => qr/regex/"
652
653           Matches the URL of the image against string or regex, as
654           appropriate.  The URL may be a relative URL, like foo/bar.html,
655           depending on how it's coded on the page.
656
657       ·   "url_abs => string" and "url_abs_regex => regex"
658
659           Matches the absolute URL of the image against string or regex, as
660           appropriate.  The URL will be an absolute URL, even if it's
661           relative in the page.
662
663       ·   "tag => string" and "tag_regex => regex"
664
665           Matches the tag that the image came from against string or regex,
666           as appropriate.  The "tag_regex" is probably most useful to check
667           for more than one tag, as in:
668
669               $mech->find_image( tag_regex => qr/^(img|input)$/ );
670
671           The tags supported are "<img>" and "<input>".
672
673       ·   "id => string" and "id_regex => regex"
674
675           "id" matches the id attribute of the image against string, which
676           must be an exact match. To select an image with the exact id
677           "download-image", use
678
679               $mech->find_image( id => 'download-image' );
680
681           "id_regex" matches the id attribute of the image against a regular
682           expression. To select the first image with an id that contains
683           "download" anywhere in it, use
684
685               $mech->find_image( id_regex => qr/download/ );
686
687       ·   "classs => string" and "class_regex => regex"
688
689           "class" matches the class attribute of the image against string,
690           which must be an exact match. To select an image with the exact
691           class "img-fuid", use
692
693               $mech->find_image( class => 'img-fluid' );
694
695           To select an image with the class attribute "rounded float-left",
696           use
697
698               $mech->find_image( class => 'rounded float-left' );
699
700           Note that the classes have to be matched as a complete string, in
701           the exact order they appear in the website's source code.
702
703           "class_regex" matches the class attribute of the image against a
704           regular expression. Use this if you want a partial class name, or
705           if an image has several classes, but you only care about one.
706
707           To select the first image with the class "rounded", where there are
708           multiple images that might also have either class "float-left" or
709           "float-right", use
710
711               $mech->find_image( class_regex => qr/\brounded\b/ );
712
713           Selecting an image with multiple classes where you do not care
714           about the order they appear in the website's source code is not
715           currently supported.
716
717       If "n" is not specified, it defaults to 1.  Therefore, if you don't
718       specify any params, this method defaults to finding the first image on
719       the page.
720
721       Note that you can specify multiple ALT or URL parameters, which will be
722       ANDed together.  For example, to find the first image with ALT text of
723       "News" and with "cnn.com" in the URL, use:
724
725           $mech->find_image( image => 'News', url_regex => qr/cnn\.com/ );
726
727       The return value is a reference to an array containing a
728       WWW::Mechanize::Image object for every image in "$self->content".
729
730   $mech->find_all_images( ... )
731       Returns all the images on the current page that match the criteria.
732       The method for specifying image criteria is the same as in
733       "find_image()".  Each of the images returned is a WWW::Mechanize::Image
734       object.
735
736       In list context, "find_all_images()" returns a list of the images.
737       Otherwise, it returns a reference to the list of images.
738
739       "find_all_images()" with no parameters returns all images in the page.
740

FORM METHODS

742       These methods let you work with the forms on a page.  The idea is to
743       choose a form that you'll later work with using the field methods
744       below.
745
746   $mech->forms
747       Lists all the forms on the current page.  Each form is an HTML::Form
748       object.  In list context, returns a list of all forms.  In scalar
749       context, returns an array reference of all forms.
750
751   $mech->form_number($number)
752       Selects the numberth form on the page as the target for subsequent
753       calls to "field()" and "click()".  Also returns the form that was
754       selected.
755
756       If it is found, the form is returned as an HTML::Form object and set
757       internally for later use with Mech's form methods such as "field()" and
758       "click()".  When called in a list context, the number of the found form
759       is also returned as a second value.
760
761       Emits a warning and returns undef if no form is found.
762
763       The first form is number 1, not zero.
764
765   $mech->form_name( $name )
766       Selects a form by name.  If there is more than one form on the page
767       with that name, then the first one is used, and a warning is generated.
768
769       If it is found, the form is returned as an HTML::Form object and set
770       internally for later use with Mech's form methods such as "field()" and
771       "click()".
772
773       Returns undef if no form is found.
774
775   $mech->form_id( $name )
776       Selects a form by ID.  If there is more than one form on the page with
777       that ID, then the first one is used, and a warning is generated.
778
779       If it is found, the form is returned as an HTML::Form object and set
780       internally for later use with Mech's form methods such as "field()" and
781       "click()".
782
783       If no form is found it returns "undef".  This will also trigger a
784       warning, unless "quiet" is enabled.
785
786   $mech->all_forms_with_fields( @fields )
787       Selects a form by passing in a list of field names it must contain.
788       All matching forms (perhaps none) are returned as a list of HTML::Form
789       objects.
790
791   $mech->form_with_fields( @fields )
792       Selects a form by passing in a list of field names it must contain.  If
793       there is more than one form on the page with that matches, then the
794       first one is used, and a warning is generated.
795
796       If it is found, the form is returned as an HTML::Form object and set
797       internally for later used with Mech's form methods such as "field()"
798       and "click()".
799
800       Returns undef and emits a warning if no form is found.
801
802       Note that this functionality requires libwww-perl 5.69 or higher.
803
804   $mech->all_forms_with( $attr1 => $value1, $attr2 => $value2, ... )
805       Searches for forms with arbitrary attribute/value pairs within the
806       <form> tag.  (Currently does not work for attribute "action" due to
807       implementation details of HTML::Form.)  When given more than one pair,
808       all criteria must match.  Using "undef" as value means that the
809       attribute in question must not be present.
810
811       All matching forms (perhaps none) are returned as a list of HTML::Form
812       objects.
813
814   $mech->form_with( $attr1 => $value1, $attr2 => $value2, ... )
815       Searches for forms with arbitrary attribute/value pairs within the
816       <form> tag.  (Currently does not work for attribute "action" due to
817       implementation details of HTML::Form.)  When given more than one pair,
818       all criteria must match.  Using "undef" as value means that the
819       attribute in question must not be present.
820
821       If it is found, the form is returned as an HTML::Form object and set
822       internally for later used with Mech's form methods such as "field()"
823       and "click()".
824
825       Returns undef if no form is found.
826

FIELD METHODS

828       These methods allow you to set the values of fields in a given form.
829
830   $mech->field( $name, $value, $number )
831   $mech->field( $name, \@values, $number )
832       Given the name of a field, set its value to the value specified.  This
833       applies to the current form (as set by the "form_name()" or
834       "form_number()" method or defaulting to the first form on the page).
835
836       The optional $number parameter is used to distinguish between two
837       fields with the same name.  The fields are numbered from 1.
838
839   $mech->select($name, $value)
840   $mech->select($name, \@values)
841       Given the name of a "select" field, set its value to the value
842       specified.  If the field is not "<select multiple>" and the $value is
843       an array, only the first value will be set.  [Note: the documentation
844       previously claimed that only the last value would be set, but this was
845       incorrect.]  Passing $value as a hash with an "n" key selects an item
846       by number (e.g.  "{n => 3}" or "{n => [2,4]}").  The numbering starts
847       at 1.  This applies to the current form.
848
849       If you have a field with "<select multiple>" and you pass a single
850       $value, then $value will be added to the list of fields selected,
851       without clearing the others.  However, if you pass an array reference,
852       then all previously selected values will be cleared.
853
854       Returns true on successfully setting the value. On failure, returns
855       false and calls "$self->warn()" with an error message.
856
857   $mech->set_fields( $name => $value ... )
858       This method sets multiple fields of the current form. It takes a list
859       of field name and value pairs. If there is more than one field with the
860       same name, the first one found is set. If you want to select which of
861       the duplicate field to set, use a value which is an anonymous array
862       which has the field value and its number as the 2 elements.
863
864               # set the second foo field
865               $mech->set_fields( $name => [ 'foo', 2 ] );
866
867       The fields are numbered from 1.
868
869       This applies to the current form.
870
871   $mech->set_visible( @criteria )
872       This method sets fields of the current form without having to know
873       their names.  So if you have a login screen that wants a username and
874       password, you do not have to fetch the form and inspect the source (or
875       use the mech-dump utility, installed with WWW::Mechanize) to see what
876       the field names are; you can just say
877
878           $mech->set_visible( $username, $password );
879
880       and the first and second fields will be set accordingly.  The method is
881       called set_visible because it acts only on visible fields; hidden form
882       inputs are not considered.  The order of the fields is the order in
883       which they appear in the HTML source which is nearly always the order
884       anyone viewing the page would think they are in, but some creative work
885       with tables could change that; caveat user.
886
887       Each element in @criteria is either a field value or a field specifier.
888       A field value is a scalar.  A field specifier allows you to specify the
889       type of input field you want to set and is denoted with an arrayref
890       containing two elements.  So you could specify the first radio button
891       with
892
893           $mech->set_visible( [ radio => 'KCRW' ] );
894
895       Field values and specifiers can be intermixed, hence
896
897           $mech->set_visible( 'fred', 'secret', [ option => 'Checking' ] );
898
899       would set the first two fields to "fred" and "secret", and the next
900       "OPTION" menu field to "Checking".
901
902       The possible field specifier types are: "text", "password", "hidden",
903       "textarea", "file", "image", "submit", "radio", "checkbox" and
904       "option".
905
906       "set_visible" returns the number of values set.
907
908   $mech->tick( $name, $value [, $set] )
909       "Ticks" the first checkbox that has both the name and value associated
910       with it on the current form.  Dies if there is no named check box for
911       that value.  Passing in a false value as the third optional argument
912       will cause the checkbox to be unticked.
913
914   $mech->untick($name, $value)
915       Causes the checkbox to be unticked.  Shorthand for
916       "tick($name,$value,undef)"
917
918   $mech->value( $name [, $number] )
919       Given the name of a field, return its value. This applies to the
920       current form.
921
922       The optional $number parameter is used to distinguish between two
923       fields with the same name.  The fields are numbered from 1.
924
925       If the field is of type file (file upload field), the value is always
926       cleared to prevent remote sites from downloading your local files.  To
927       upload a file, specify its file name explicitly.
928
929   $mech->click( $button [, $x, $y] )
930       Has the effect of clicking a button on the current form.  The first
931       argument is the name of the button to be clicked.  The second and third
932       arguments (optional) allow you to specify the (x,y) coordinates of the
933       click.
934
935       If there is only one button on the form, "$mech->click()" with no
936       arguments simply clicks that one button.
937
938       Returns an HTTP::Response object.
939
940   $mech->click_button( ... )
941       Has the effect of clicking a button on the current form by specifying
942       its name, value, or index.  Its arguments are a list of key/value
943       pairs.  Only one of name, number, input or value must be specified in
944       the keys.
945
946       ·   "name => name"
947
948           Clicks the button named name in the current form.
949
950       ·   "id => id"
951
952           Clicks the button with the id id in the current form.
953
954       ·   "number => n"
955
956           Clicks the nth button in the current form. Numbering starts at 1.
957
958       ·   "value => value"
959
960           Clicks the button with the value value in the current form.
961
962       ·   "input => $inputobject"
963
964           Clicks on the button referenced by $inputobject, an instance of
965           HTML::Form::SubmitInput obtained e.g. from
966
967               $mech->current_form()->find_input( undef, 'submit' )
968
969           $inputobject must belong to the current form.
970
971       ·   "x => x"
972
973       ·   "y => y"
974
975           These arguments (optional) allow you to specify the (x,y)
976           coordinates of the click.
977
978   $mech->submit()
979       Submits the current form, without specifying a button to click.
980       Actually, no button is clicked at all.
981
982       Returns an HTTP::Response object.
983
984       This used to be a synonym for "$mech->click( 'submit' )", but is no
985       longer so.
986
987   $mech->submit_form( ... )
988       This method lets you select a form from the previously fetched page,
989       fill in its fields, and submit it. It combines the
990       "form_number"/"form_name", "set_fields" and "click" methods into one
991       higher level call. Its arguments are a list of key/value pairs, all of
992       which are optional.
993
994       ·   "fields => \%fields"
995
996           Specifies the fields to be filled in the current form.
997
998       ·   "with_fields => \%fields"
999
1000           Probably all you need for the common case. It combines a smart form
1001           selector and data setting in one operation. It selects the first
1002           form that contains all fields mentioned in "\%fields".  This is
1003           nice because you don't need to know the name or number of the form
1004           to do this.
1005
1006           (calls "form_with_fields()" and
1007                  "set_fields()").
1008
1009           If you choose "with_fields", the "fields" option will be ignored.
1010           The "form_number", "form_name" and "form_id" options will still be
1011           used.  An exception will be thrown unless exactly one form matches
1012           all of the provided criteria.
1013
1014       ·   "form_number => n"
1015
1016           Selects the nth form (calls "form_number()".  If this param is not
1017           specified, the currently-selected form is used.
1018
1019       ·   "form_name => name"
1020
1021           Selects the form named name (calls "form_name()")
1022
1023       ·   "form_id => ID"
1024
1025           Selects the form with ID ID (calls "form_id()")
1026
1027       ·   "button => button"
1028
1029           Clicks on button button (calls "click()")
1030
1031       ·   "x => x, y => y"
1032
1033           Sets the x or y values for "click()"
1034
1035       ·   "strict_forms => bool"
1036
1037           Sets the HTML::Form strict flag which causes form submission to
1038           croak if any of the passed fields don't exist on the page, and/or a
1039           value doesn't exist in a select element.  By default HTML::Form
1040           sets this value to false.
1041
1042           This behavior can also be turned on globally by passing
1043           "strict_forms => 1" to "WWW::Mechanize->new". If you do that, you
1044           can still disable it for individual calls by passing "strict_forms
1045           => 0" here.
1046
1047       If no form is selected, the first form found is used.
1048
1049       If button is not passed, then the "submit()" method is used instead.
1050
1051       If you want to submit a file and get its content from a scalar rather
1052       than a file in the filesystem, you can use:
1053
1054           $mech->submit_form(with_fields => { logfile => [ [ undef, 'whatever', Content => $content ], 1 ] } );
1055
1056       Returns an HTTP::Response object.
1057

MISCELLANEOUS METHODS

1059   $mech->add_header( name => $value [, name => $value... ] )
1060       Sets HTTP headers for the agent to add or remove from the HTTP request.
1061
1062           $mech->add_header( Encoding => 'text/klingon' );
1063
1064       If a value is "undef", then that header will be removed from any future
1065       requests.  For example, to never send a Referer header:
1066
1067           $mech->add_header( Referer => undef );
1068
1069       If you want to delete a header, use "delete_header".
1070
1071       Returns the number of name/value pairs added.
1072
1073       NOTE: This method was very different in WWW::Mechanize before 1.00.
1074       Back then, the headers were stored in a package hash, not as a member
1075       of the object instance.  Calling "add_header()" would modify the
1076       headers for every WWW::Mechanize object, even after your object no
1077       longer existed.
1078
1079   $mech->delete_header( name [, name ... ] )
1080       Removes HTTP headers from the agent's list of special headers.  For
1081       instance, you might need to do something like:
1082
1083           # Don't send a Referer for this URL
1084           $mech->add_header( Referer => undef );
1085
1086           # Get the URL
1087           $mech->get( $url );
1088
1089           # Back to the default behavior
1090           $mech->delete_header( 'Referer' );
1091
1092   $mech->quiet(true/false)
1093       Allows you to suppress warnings to the screen.
1094
1095           $mech->quiet(0); # turns on warnings (the default)
1096           $mech->quiet(1); # turns off warnings
1097           $mech->quiet();  # returns the current quietness status
1098
1099   $mech->stack_depth( $max_depth )
1100       Get or set the page stack depth. Use this if you're doing a lot of page
1101       scraping and running out of memory.
1102
1103       A value of 0 means "no history at all."  By default, the max stack
1104       depth is humongously large, effectively keeping all history.
1105
1106   $mech->save_content( $filename, %opts )
1107       Dumps the contents of "$mech->content" into $filename.  $filename will
1108       be overwritten.  Dies if there are any errors.
1109
1110       If the content type does not begin with "text/", then the content is
1111       saved in binary mode (i.e. "binmode()" is set on the output
1112       filehandle).
1113
1114       Additional arguments can be passed as key/value pairs:
1115
1116       $mech->save_content( $filename, binary => 1 )
1117           Filehandle is set with "binmode" to ":raw" and contents are taken
1118           calling "$self->content(decoded_by_headers => 1)". Same as calling:
1119
1120               $mech->save_content( $filename, binmode => ':raw',
1121                                    decoded_by_headers => 1 );
1122
1123           This should be the safest way to save contents verbatim.
1124
1125       $mech->save_content( $filename, binmode => $binmode )
1126           Filehandle is set to binary mode. If $binmode begins with ':', it
1127           is passed as a parameter to "binmode":
1128
1129               binmode $fh, $binmode;
1130
1131           otherwise the filehandle is set to binary mode if $binmode is true:
1132
1133               binmode $fh;
1134
1135       all other arguments
1136           are passed as-is to "$mech->content(%opts)". In particular,
1137           "decoded_by_headers" might come handy if you want to revert the
1138           effect of line compression performed by the web server but without
1139           further interpreting the contents (e.g. decoding it according to
1140           the charset).
1141
1142   $mech->dump_headers( [$fh] )
1143       Prints a dump of the HTTP response headers for the most recent
1144       response.  If $fh is not specified or is undef, it dumps to STDOUT.
1145
1146       Unlike the rest of the dump_* methods, $fh can be a scalar. It will be
1147       used as a file name.
1148
1149   $mech->dump_links( [[$fh], $absolute] )
1150       Prints a dump of the links on the current page to $fh.  If $fh is not
1151       specified or is undef, it dumps to STDOUT.
1152
1153       If $absolute is true, links displayed are absolute, not relative.
1154
1155   $mech->dump_images( [[$fh], $absolute] )
1156       Prints a dump of the images on the current page to $fh.  If $fh is not
1157       specified or is undef, it dumps to STDOUT.
1158
1159       If $absolute is true, links displayed are absolute, not relative.
1160
1161       The output will include empty lines for images that have no "src"
1162       attribute and therefore no "<-"url>>.
1163
1164   $mech->dump_forms( [$fh] )
1165       Prints a dump of the forms on the current page to $fh.  If $fh is not
1166       specified or is undef, it dumps to STDOUT. Running the following:
1167
1168           my $mech = WWW::Mechanize->new();
1169           $mech->get("https://www.google.com/");
1170           $mech->dump_forms;
1171
1172       will print:
1173
1174           GET https://www.google.com/search [f]
1175             ie=ISO-8859-1                  (hidden readonly)
1176             hl=en                          (hidden readonly)
1177             source=hp                      (hidden readonly)
1178             biw=                           (hidden readonly)
1179             bih=                           (hidden readonly)
1180             q=                             (text)
1181             btnG=Google Search             (submit)
1182             btnI=I'm Feeling Lucky         (submit)
1183             gbv=1                          (hidden readonly)
1184
1185   $mech->dump_text( [$fh] )
1186       Prints a dump of the text on the current page to $fh.  If $fh is not
1187       specified or is undef, it dumps to STDOUT.
1188

OVERRIDDEN LWP::UserAgent METHODS

1190   $mech->clone()
1191       Clone the mech object.  The clone will be using the same cookie jar as
1192       the original mech.
1193
1194   $mech->redirect_ok()
1195       An overloaded version of "redirect_ok()" in LWP::UserAgent.  This
1196       method is used to determine whether a redirection in the request should
1197       be followed.
1198
1199       Note that WWW::Mechanize's constructor pushes POST on to the agent's
1200       "requests_redirectable" list.
1201
1202   $mech->request( $request [, $arg [, $size]])
1203       Overloaded version of "request()" in LWP::UserAgent.  Performs the
1204       actual request.  Normally, if you're using WWW::Mechanize, it's because
1205       you don't want to deal with this level of stuff anyway.
1206
1207       Note that $request will be modified.
1208
1209       Returns an HTTP::Response object.
1210
1211   $mech->update_html( $html )
1212       Allows you to replace the HTML that the mech has found.  Updates the
1213       forms and links parse-trees that the mech uses internally.
1214
1215       Say you have a page that you know has malformed output, and you want to
1216       update it so the links come out correctly:
1217
1218           my $html = $mech->content;
1219           $html =~ s[</option>.{0,3}</td>][</option></select></td>]isg;
1220           $mech->update_html( $html );
1221
1222       This method is also used internally by the mech itself to update its
1223       own HTML content when loading a page. This means that if you would like
1224       to systematically perform the above HTML substitution, you would
1225       overload update_html in a subclass thusly:
1226
1227          package MyMech;
1228          use base 'WWW::Mechanize';
1229
1230          sub update_html {
1231              my ($self, $html) = @_;
1232              $html =~ s[</option>.{0,3}</td>][</option></select></td>]isg;
1233              $self->WWW::Mechanize::update_html( $html );
1234          }
1235
1236       If you do this, then the mech will use the tidied-up HTML instead of
1237       the original both when parsing for its own needs, and for returning to
1238       you through "content()".
1239
1240       Overloading this method is also the recommended way of implementing
1241       extra validation steps (e.g. link checkers) for every HTML page
1242       received.  "warn" and "die" would then come in handy to signal
1243       validation errors.
1244
1245   $mech->credentials( $username, $password )
1246       Provide credentials to be used for HTTP Basic authentication for all
1247       sites and realms until further notice.
1248
1249       The four argument form described in LWP::UserAgent is still supported.
1250
1251   $mech->get_basic_credentials( $realm, $uri, $isproxy )
1252       Returns the credentials for the realm and URI.
1253
1254   $mech->clear_credentials()
1255       Remove any credentials set up with "credentials()".
1256

INHERITED UNCHANGED LWP::UserAgent METHODS

1258       As a subclass of LWP::UserAgent, WWW::Mechanize inherits all of
1259       LWP::UserAgent's methods.  Many of which are overridden or extended.
1260       The following methods are inherited unchanged. View the LWP::UserAgent
1261       documentation for their implementation descriptions.
1262
1263       This is not meant to be an inclusive list.  LWP::UA may have added
1264       others.
1265
1266   $mech->head()
1267       Inherited from LWP::UserAgent.
1268
1269   $mech->mirror()
1270       Inherited from LWP::UserAgent.
1271
1272   $mech->simple_request()
1273       Inherited from LWP::UserAgent.
1274
1275   $mech->is_protocol_supported()
1276       Inherited from LWP::UserAgent.
1277
1278   $mech->prepare_request()
1279       Inherited from LWP::UserAgent.
1280
1281   $mech->progress()
1282       Inherited from LWP::UserAgent.
1283

INTERNAL-ONLY METHODS

1285       These methods are only used internally.  You probably don't need to
1286       know about them.
1287
1288   $mech->_update_page($request, $response)
1289       Updates all internal variables in $mech as if $request was just
1290       performed, and returns $response. The page stack is not altered by this
1291       method, it is up to caller (e.g.  "request") to do that.
1292
1293   $mech->_modify_request( $req )
1294       Modifies a HTTP::Request before the request is sent out, for both GET
1295       and POST requests.
1296
1297       We add a "Referer" header, as well as header to note that we can accept
1298       gzip encoded content, if Compress::Zlib is installed.
1299
1300   $mech->_make_request()
1301       Convenience method to make it easier for subclasses like
1302       WWW::Mechanize::Cached to intercept the request.
1303
1304   $mech->_reset_page()
1305       Resets the internal fields that track page parsed stuff.
1306
1307   $mech->_extract_links()
1308       Extracts links from the content of a webpage, and populates the
1309       "{links}" property with WWW::Mechanize::Link objects.
1310
1311   $mech->_push_page_stack()
1312       The agent keeps a stack of visited pages, which it can pop when it
1313       needs to go BACK and so on.
1314
1315       The current page needs to be pushed onto the stack before we get a new
1316       page, and the stack needs to be popped when BACK occurs.
1317
1318       Neither of these take any arguments, they just operate on the $mech
1319       object.
1320
1321   warn( @messages )
1322       Centralized warning method, for diagnostics and non-fatal problems.
1323       Defaults to calling "CORE::warn", but may be overridden by setting
1324       "onwarn" in the constructor.
1325
1326   die( @messages )
1327       Centralized error method.  Defaults to calling "CORE::die", but may be
1328       overridden by setting "onerror" in the constructor.
1329

BEST PRACTICES

1331       The default settings can get you up and running quickly, but there are
1332       settings you can change in order to make your life easier.
1333
1334       autocheck
1335           "autocheck" can save you the overhead of checking status codes for
1336           success.  You may outgrow it as your needs get more sophisticated,
1337           but it's a safe option to start with.
1338
1339               my $agent = WWW::Mechanize->new( autocheck => 1 );
1340
1341       cookie_jar
1342           You are encouraged to install Mozilla::PublicSuffix and use
1343           HTTP::CookieJar::LWP as your cookie jar.  HTTP::CookieJar::LWP
1344           provides a better security model matching that of current Web
1345           browsers when Mozilla::PublicSuffix is installed.
1346
1347               use HTTP::CookieJar::LWP ();
1348
1349               my $jar = HTTP::CookieJar::LWP->new;
1350               my $agent = WWW::Mechanize->new( cookie_jar => $jar );
1351
1352       protocols_allowed
1353           This option is inherited directly from LWP::UserAgent.  It allows
1354           you to whitelist the protocols you're willing to allow.
1355
1356               my $agent = WWW::Mechanize->new(
1357                   protocols_allowed => [ 'http', 'https' ]
1358               );
1359
1360           This will prevent you from inadvertently following URLs like
1361           "file:///etc/passwd"
1362
1363       protocols_forbidden
1364           This option is also inherited directly from LWP::UserAgent.  It
1365           allows you to blacklist the protocols you're unwilling to allow.
1366
1367               my $agent = WWW::Mechanize->new(
1368                   protocols_forbidden => [ 'file', 'mailto', 'ssh', ]
1369               );
1370
1371           This will prevent you from inadvertently following URLs like
1372           "file:///etc/passwd"
1373
1374       strict_forms
1375           Consider turning on the "strict_forms" option when you create a new
1376           Mech.  This will perform a helpful sanity check on form fields
1377           every time you are submitting a form, which can save you a lot of
1378           debugging time.
1379
1380               my $agent = WWW::Mechanize->new( strict_forms => 1 );
1381
1382           If you do not want to have this option globally, you can still turn
1383           it on for individual forms.
1384
1385               $agent->submit_form( fields => { foo => 'bar' } , strict_forms => 1 );
1386

WWW::MECHANIZE'S GIT REPOSITORY

1388       WWW::Mechanize is hosted at GitHub.
1389
1390       Repository: <https://github.com/libwww-perl/WWW-Mechanize>.  Bugs:
1391       <https://github.com/libwww-perl/WWW-Mechanize/issues>.
1392

OTHER DOCUMENTATION

1394   Spidering Hacks, by Kevin Hemenway and Tara Calishain
1395       Spidering Hacks from O'Reilly
1396       (<http://www.oreilly.com/catalog/spiderhks/>) is a great book for
1397       anyone wanting to know more about screen-scraping and spidering.
1398
1399       There are six hacks that use Mech or a Mech derivative:
1400
1401       #21 WWW::Mechanize 101
1402       #22 Scraping with WWW::Mechanize
1403       #36 Downloading Images from Webshots
1404       #44 Archiving Yahoo! Groups Messages with WWW::Yahoo::Groups
1405       #64 Super Author Searching
1406       #73 Scraping TV Listings
1407
1408       The book was also positively reviewed on Slashdot:
1409       <http://books.slashdot.org/article.pl?sid=03/12/11/2126256>
1410

ONLINE RESOURCES AND SUPPORT

1412       ·   WWW::Mechanize mailing list
1413
1414           The Mech mailing list is at
1415           <http://groups.google.com/group/www-mechanize-users> and is
1416           specific to Mechanize, unlike the LWP mailing list below.  Although
1417           it is a users list, all development discussion takes place here,
1418           too.
1419
1420       ·   LWP mailing list
1421
1422           The LWP mailing list is at
1423           <http://lists.perl.org/showlist.cgi?name=libwww>, and is more user-
1424           oriented and well-populated than the WWW::Mechanize list.
1425
1426       ·   Perlmonks
1427
1428           <http://perlmonks.org> is an excellent community of support, and
1429           many questions about Mech have already been answered there.
1430
1431       ·   WWW::Mechanize::Examples
1432
1433           A random array of examples submitted by users, included with the
1434           Mechanize distribution.
1435

ARTICLES ABOUT WWW::MECHANIZE

1437       ·   <http://www.ibm.com/developerworks/linux/library/wa-perlsecure/>
1438
1439           IBM article "Secure Web site access with Perl"
1440
1441       ·   <http://www.oreilly.com/catalog/googlehks2/chapter/hack84.pdf>
1442
1443           Leland Johnson's hack #84 in Google Hacks, 2nd Edition is an
1444           example of a production script that uses WWW::Mechanize and
1445           HTML::TableContentParser. It takes in keywords and returns the
1446           estimated price of these keywords on Google's AdWords program.
1447
1448       ·   <http://www.perl.com/pub/a/2004/06/04/recorder.html>
1449
1450           Linda Julien writes about using HTTP::Recorder to create
1451           WWW::Mechanize scripts.
1452
1453       ·   <http://www.developer.com/lang/other/article.php/3454041>
1454
1455           Jason Gilmore's article on using WWW::Mechanize for scraping sales
1456           information from Amazon and eBay.
1457
1458       ·   <http://www.perl.com/pub/a/2003/01/22/mechanize.html>
1459
1460           Chris Ball's article about using WWW::Mechanize for scraping TV
1461           listings.
1462
1463       ·   <http://www.stonehenge.com/merlyn/LinuxMag/col47.html>
1464
1465           Randal Schwartz's article on scraping Yahoo News for images.  It's
1466           already out of date: He manually walks the list of links hunting
1467           for matches, which wouldn't have been necessary if the
1468           "find_link()" method existed at press time.
1469
1470       ·   <http://www.perladvent.org/2002/16th/>
1471
1472           WWW::Mechanize on the Perl Advent Calendar, by Mark Fowler.
1473
1474       ·   <http://www.linux-magazin.de/ausgaben/2004/03/datenruessel/>
1475
1476           Michael Schilli's article on Mech and WWW::Mechanize::Shell for the
1477           German magazine Linux Magazin.
1478
1479   Other modules that use Mechanize
1480       Here are modules that use or subclass Mechanize.  Let me know of any
1481       others:
1482
1483       ·   Finance::Bank::LloydsTSB
1484
1485       ·   HTTP::Recorder
1486
1487           Acts as a proxy for web interaction, and then generates
1488           WWW::Mechanize scripts.
1489
1490       ·   Win32::IE::Mechanize
1491
1492           Just like Mech, but using Microsoft Internet Explorer to do the
1493           work.
1494
1495       ·   WWW::Bugzilla
1496
1497       ·   WWW::CheckSite
1498
1499       ·   WWW::Google::Groups
1500
1501       ·   WWW::Hotmail
1502
1503       ·   WWW::Mechanize::Cached
1504
1505       ·   WWW::Mechanize::Cached::GZip
1506
1507       ·   WWW::Mechanize::FormFiller
1508
1509       ·   WWW::Mechanize::Shell
1510
1511       ·   WWW::Mechanize::Sleepy
1512
1513       ·   WWW::Mechanize::SpamCop
1514
1515       ·   WWW::Mechanize::Timed
1516
1517       ·   WWW::SourceForge
1518
1519       ·   WWW::Yahoo::Groups
1520
1521       ·   WWW::Scripter
1522

ACKNOWLEDGEMENTS

1524       Thanks to the numerous people who have helped out on WWW::Mechanize in
1525       one way or another, including Kirrily Robert for the original
1526       "WWW::Automate", Lyle Hopkins, Damien Clark, Ansgar Burchardt, Gisle
1527       Aas, Jeremy Ary, Hilary Holz, Rafael Kitover, Norbert Buchmuller, Dave
1528       Page, David Sainty, H.Merijn Brand, Matt Lawrence, Michael Schwern,
1529       Adriano Ferreira, Miyagawa, Peteris Krumins, Rafael Kitover, David
1530       Steinbrunner, Kevin Falcone, Mike O'Regan, Mark Stosberg, Uri Guttman,
1531       Peter Scott, Philippe Bruhat, Ian Langworth, John Beppu, Gavin Estey,
1532       Jim Brandt, Ask Bjoern Hansen, Greg Davies, Ed Silva, Mark-Jason
1533       Dominus, Autrijus Tang, Mark Fowler, Stuart Children, Max Maischein,
1534       Meng Wong, Prakash Kailasa, Abigail, Jan Pazdziora, Dominique
1535       Quatravaux, Scott Lanning, Rob Casey, Leland Johnson, Joshua Gatcomb,
1536       Julien Beasley, Abe Timmerman, Peter Stevens, Pete Krawczyk, Tad
1537       McClellan, and the late great Iain Truskett.
1538

AUTHOR

1540       Andy Lester <andy at petdance.com>
1541
1543       This software is copyright (c) 2004 by Andy Lester.
1544
1545       This is free software; you can redistribute it and/or modify it under
1546       the same terms as the Perl 5 programming language system itself.
1547
1548
1549
1550perl v5.32.0                      2020-07-28                 WWW::Mechanize(3)
Impressum