{
    "mode": "perldoc",
    "parameter": "WWW::Mechanize",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/WWW%3A%3AMechanize/json",
    "generated": "2026-06-13T22:59:10Z",
    "synopsis": "WWW::Mechanize supports performing a sequence of page fetches including following links and\nsubmitting forms. Each fetched page is parsed and its links and forms are extracted. A link or a\nform can be selected, form fields can be filled and the next page can be fetched. Mech also\nstores a history of the URLs you've visited, which can be queried and revisited.\nuse WWW::Mechanize ();\nmy $mech = WWW::Mechanize->new();\n$mech->get( $url );\n$mech->followlink( n => 3 );\n$mech->followlink( textregex => qr/download this/i );\n$mech->followlink( url => 'http://host.com/index.html' );\n$mech->submitform(\nformnumber => 3,\nfields      => {\nusername    => 'mungo',\npassword    => 'lost-and-alone',\n}\n);\n$mech->submitform(\nformname => 'search',\nfields    => { query  => 'pot of gold', },\nbutton    => 'Search Now'\n);\n# Enable strict form processing to catch typos and non-existant form fields.\nmy $strictmech = WWW::Mechanize->new( strictforms => 1);\n$strictmech->get( $url );\n# This method call will die, saving you lots of time looking for the bug.\n$strictmech->submitform(\nformnumber => 3,\nfields      => {\nusernaem     => 'mungo',           # typo in field name\npassword     => 'lost-and-alone',\nextrafield  => 123,               # field does not exist\n}\n);",
    "sections": {
        "NAME": {
            "content": "WWW::Mechanize - Handy web browsing in a Perl object\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.06\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "WWW::Mechanize supports performing a sequence of page fetches including following links and\nsubmitting forms. Each fetched page is parsed and its links and forms are extracted. A link or a\nform can be selected, form fields can be filled and the next page can be fetched. Mech also\nstores a history of the URLs you've visited, which can be queried and revisited.\n\nuse WWW::Mechanize ();\nmy $mech = WWW::Mechanize->new();\n\n$mech->get( $url );\n\n$mech->followlink( n => 3 );\n$mech->followlink( textregex => qr/download this/i );\n$mech->followlink( url => 'http://host.com/index.html' );\n\n$mech->submitform(\nformnumber => 3,\nfields      => {\nusername    => 'mungo',\npassword    => 'lost-and-alone',\n}\n);\n\n$mech->submitform(\nformname => 'search',\nfields    => { query  => 'pot of gold', },\nbutton    => 'Search Now'\n);\n\n# Enable strict form processing to catch typos and non-existant form fields.\nmy $strictmech = WWW::Mechanize->new( strictforms => 1);\n\n$strictmech->get( $url );\n\n# This method call will die, saving you lots of time looking for the bug.\n$strictmech->submitform(\nformnumber => 3,\nfields      => {\nusernaem     => 'mungo',           # typo in field name\npassword     => 'lost-and-alone',\nextrafield  => 123,               # field does not exist\n}\n);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"WWW::Mechanize\", or Mech for short, is a Perl module for stateful programmatic web browsing,\nused for automating interaction with websites.\n\nFeatures include:\n\n*   All HTTP methods\n\n*   High-level hyperlink and HTML form support, without having to parse HTML yourself\n\n*   SSL support\n\n*   Automatic cookies\n\n*   Custom HTTP headers\n\n*   Automatic handling of redirections\n\n*   Proxies\n\n*   HTTP authentication\n\nMech is well suited for use in testing web applications. If you use one of the Test::*, like\nTest::HTML::Lint modules, you can check the fetched content and use that as input to a test\ncall.\n\nuse Test::More;\nlike( $mech->content(), qr/$expected/, \"Got expected content\" );\n\nEach page fetch stores its URL in a history stack which you can traverse.\n\n$mech->back();\n\nIf you want finer control over your page fetching, you can use these methods. \"followlink\" and\n\"submitform\" are just high level wrappers around them.\n\n$mech->findlink( n => $number );\n$mech->formnumber( $number );\n$mech->formname( $name );\n$mech->field( $name, $value );\n$mech->setfields( %fieldvalues );\n$mech->setvisible( @criteria );\n$mech->click( $button );\n\nWWW::Mechanize is a proper subclass of LWP::UserAgent and you can also use any of\nLWP::UserAgent's methods.\n\n$mech->addheader($name => $value);\n\nPlease note that Mech does NOT support JavaScript, you need additional software for that. Please\ncheck \"JavaScript\" in WWW::Mechanize::FAQ for more.\n",
            "subsections": []
        },
        "IMPORTANT LINKS": {
            "content": "*   <https://github.com/libwww-perl/WWW-Mechanize/issues>\n\nThe queue for bugs & enhancements in WWW::Mechanize. Please note that the queue at\n<http://rt.cpan.org> is no longer maintained.\n\n*   <https://metacpan.org/pod/WWW::Mechanize>\n\nThe CPAN documentation page for Mechanize.\n\n*   <https://metacpan.org/pod/distribution/WWW-Mechanize/lib/WWW/Mechanize/FAQ.pod>\n\nFrequently asked questions. Make sure you read here FIRST.\n",
            "subsections": []
        },
        "CONSTRUCTOR AND STARTUP": {
            "content": "new()\nCreates and returns a new WWW::Mechanize object, hereafter referred to as the \"agent\".\n\nmy $mech = WWW::Mechanize->new()\n\nThe constructor for WWW::Mechanize overrides two of the params to the LWP::UserAgent\nconstructor:\n\nagent => 'WWW-Mechanize/#.##'\ncookiejar => {}    # an empty, memory-only HTTP::Cookies object\n\nYou can override these overrides by passing params to the constructor, as in:\n\nmy $mech = WWW::Mechanize->new( agent => 'wonderbot 1.01' );\n\nIf you want none of the overhead of a cookie jar, or don't want your bot accepting cookies, you\nhave to explicitly disallow it, like so:\n\nmy $mech = WWW::Mechanize->new( cookiejar => undef );\n\nHere are the params that WWW::Mechanize recognizes. These do not include params that\nLWP::UserAgent recognizes.\n\n*   \"autocheck => [0|1]\"\n\nChecks each request made to see if it was successful. This saves you the trouble of manually\nchecking yourself. Any errors found are errors, not warnings.\n\nThe default value is ON, unless it's being subclassed, in which case it is OFF. This means\nthat standalone WWW::Mechanize instances have autocheck turned on, which is protective for\nthe vast majority of Mech users who don't bother checking the return value of get() and\npost() and can't figure why their code fails. However, if WWW::Mechanize is subclassed, such\nas for Test::WWW::Mechanize or Test::WWW::Mechanize::Catalyst, this may not be an\nappropriate default, so it's off.\n\n*   \"noproxy => [0|1]\"\n\nTurn off the automatic call to the LWP::UserAgent \"envproxy\" function.\n\nThis needs to be explicitly turned off if you're using Crypt::SSLeay to access a https site\nvia a proxy server. Note: you still need to set your HTTPSPROXY environment variable as\nappropriate.\n\n*   \"onwarn => \\&func\"\n\nReference to a \"warn\"-compatible function, such as \"Carp::carp\", that is called when a\nwarning needs to be shown.\n\nIf this is set to \"undef\", no warnings will ever be shown. However, it's probably better to\nuse the \"quiet\" method to control that behavior.\n\nIf this value is not passed, Mech uses \"Carp::carp\" if Carp is installed, or \"CORE::warn\" if\nnot.\n\n*   \"onerror => \\&func\"\n\nReference to a \"die\"-compatible function, such as \"Carp::croak\", that is called when there's\na fatal error.\n\nIf this is set to \"undef\", no errors will ever be shown.\n\nIf this value is not passed, Mech uses \"Carp::croak\" if Carp is installed, or \"CORE::die\" if\nnot.\n\n*   \"quiet => [0|1]\"\n\nDon't complain on warnings. Setting \"quiet => 1\" is the same as calling \"$mech->quiet(1)\".\nDefault is off.\n\n*   \"stackdepth => $value\"\n\nSets the depth of the page stack that keeps track of all the downloaded pages. Default is\neffectively infinite stack size. If the stack is eating up your memory, then set this to a\nsmaller number, say 5 or 10. Setting this to zero means Mech will keep no history.\n\nIn addition, WWW::Mechanize also allows you to globally enable strict and verbose mode for form\nhandling, which is done with HTML::Form.\n\n*   \"strictforms => [0|1]\"\n\nGlobally sets the HTML::Form strict flag which causes form submission to croak if any of the\npassed fields don't exist in the form, and/or a value doesn't exist in a select element.\nThis can still be disabled in individual calls to \"submitform()\".\n\nDefault is off.\n\n*   \"verboseforms => [0|1]\"\n\nGlobally sets the HTML::Form verbose flag which causes form submission to warn about any bad\nHTML form constructs found. This cannot be disabled later.\n\nDefault is off.\n\n*   \"markedsections => [0|1]\"\n\nGlobally sets the HTML::Parser marked sections flag which causes HTML \"CDATA[[\" sections to\nbe honoured. This cannot be disabled later.\n\nDefault is on.\n\nTo support forms, WWW::Mechanize's constructor pushes POST on to the agent's\n\"requestsredirectable\" list (see also LWP::UserAgent.)\n\n$mech->agentalias( $alias )\nSets the user agent string to the expanded version from a table of actual user strings. *$alias*\ncan be one of the following:\n\n*   Windows IE 6\n\n*   Windows Mozilla\n\n*   Mac Safari\n\n*   Mac Mozilla\n\n*   Linux Mozilla\n\n*   Linux Konqueror\n\nthen it will be replaced with a more interesting one. For instance,\n\n$mech->agentalias( 'Windows IE 6' );\n\nsets your User-Agent to\n\nMozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\n\nThe list of valid aliases can be returned from \"knownagentaliases()\". The current list is:\n\n*   Windows IE 6\n\n*   Windows Mozilla\n\n*   Mac Safari\n\n*   Mac Mozilla\n\n*   Linux Mozilla\n\n*   Linux Konqueror\n\nknownagentaliases()\nReturns a list of all the agent aliases that Mech knows about.\n",
            "subsections": []
        },
        "PAGE-FETCHING METHODS": {
            "content": "$mech->get( $uri )\nGiven a URL/URI, fetches it. Returns an HTTP::Response object. *$uri* can be a well-formed URL\nstring, a URI object, or a WWW::Mechanize::Link object.\n\nThe results are stored internally in the agent object, but you don't know that. Just use the\naccessors listed below. Poking at the internals is deprecated and subject to change in the\nfuture.\n\n\"get()\" is a well-behaved overloaded version of the method in LWP::UserAgent. This lets you do\nthings like\n\n$mech->get( $uri, ':contentfile' => $filename );\n\nand you can rest assured that the params will get filtered down appropriately. See \"get\" in\nLWP::UserAgent for more details.\n\nNOTE: Because \":contentfile\" causes the page contents to be stored in a file instead of the\nresponse object, some Mech functions that expect it to be there won't work as expected. Use with\ncaution.\n\nHere is a non-complete list of methods that do not work as expected with \":contentfile\": \"",
            "subsections": [
                {
                    "name": "forms",
                    "content": "content-handling methods, all link methods, all image methods, all form methods, all field\nmethods, \" savecontent(...) \", \" dumplinks(...) \", \" dumpimages(...) \", \" dumpforms(...) \",\n\" dumptext(...) \"\n\n$mech->post( $uri, content => $content )\nPOSTs *$content* to *$uri*. Returns an HTTP::Response object. *$uri* can be a well-formed URI\nstring, a URI object, or a WWW::Mechanize::Link object.\n\n$mech->put( $uri, content => $content )\nPUTs *$content* to *$uri*. Returns an HTTP::Response object. *$uri* can be a well-formed URI\nstring, a URI object, or a WWW::Mechanize::Link object.\n\nmy $res = $mech->head( $uri );\nmy $res = $mech->head( $uri , $fieldname => $value, ... );\n\n$mech->head ($uri )\nPerforms a HEAD request to *$uri*. Returns an HTTP::Response object. *$uri* can be a well-formed\nURI string, a URI object, or a WWW::Mechanize::Link object.\n\n$mech->reload()\nActs like the reload button in a browser: repeats the current request. The history (as per the"
                },
                {
                    "name": "back",
                    "content": "Returns the HTTP::Response object from the reload, or \"undef\" if there's no current request.\n\n$mech->back()\nThe equivalent of hitting the \"back\" button in a browser. Returns to the previous page. Won't go\nback past the first page. (Really, what would it do if it could?)\n\nReturns true if it could go back, or false if not.\n\n$mech->clearhistory()\nThis deletes all the history entries and returns true.\n\n$mech->historycount()\nThis returns the number of items in the browser history. This number *does* include the most\nrecently made request.\n\n$mech->history($n)\nThis returns the *n*th item in history. The 0th item is the most recent request and response,\nwhich would be acted on by methods like \"findlink()\". The 1st item is the state you'd return to\nif you called \"back()\".\n\nThe maximum useful value for $n is \"$mech->historycount - 1\". Requests beyond that bound will\nreturn \"undef\".\n\nHistory items are returned as hash references, in the form:\n\n{ req => $httprequest, res => $httpresponse }\n"
                }
            ]
        },
        "STATUS METHODS": {
            "content": "$mech->success()\nReturns a boolean telling whether the last request was successful. If there hasn't been an\noperation yet, returns false.\n\nThis is a convenience function that wraps \"$mech->res->issuccess\".\n\n$mech->uri()\nReturns the current URI as a URI object. This object stringifies to the URI itself.\n\n$mech->response() / $mech->res()\nReturn the current response as an HTTP::Response object.\n\nSynonym for \"$mech->response()\"\n\n$mech->status()\nReturns the HTTP status code of the response. This is a 3-digit number like 200 for OK, 404 for\nnot found, and so on.\n\n$mech->ct() / $mech->contenttype()\nReturns the content type of the response.\n\n$mech->base()\nReturns the base URI for the current response\n\n$mech->forms()\nWhen called in a list context, returns a list of the forms found in the last fetched page. In a\nscalar context, returns a reference to an array with those forms. The forms returned are all\nHTML::Form objects.\n\n$mech->currentform()\nReturns the current form as an HTML::Form object.\n\n$mech->links()\nWhen called in a list context, returns a list of the links found in the last fetched page. In a\nscalar context it returns a reference to an array with those links. Each link is a\nWWW::Mechanize::Link object.\n\n$mech->ishtml()\nReturns true/false on whether our content is HTML, according to the HTTP headers.\n\n$mech->title()\nReturns the contents of the \"<TITLE>\" tag, as parsed by HTML::HeadParser. Returns undef if the\ncontent is not HTML.\n\n$mech->redirects()\nConvenience method to get the redirects from the most recent HTTP::Response.\n\nNote that you can also use isredirect to see if the most recent response was a redirect like\nthis.\n\n$mech->get($url);\ndostuff() if $mech->res->isredirect;\n",
            "subsections": []
        },
        "CONTENT-HANDLING METHODS": {
            "content": "$mech->content(...)\nReturns the content that the mech uses internally for the last page fetched. Ordinarily this is\nthe same as \"$mech->response()->decodedcontent()\", but this may differ for HTML documents if\nupdatehtml is overloaded (in which case the value passed to the base-class implementation of\nsame will be returned), and/or extra named arguments are passed to *content()*:\n\n*$mech->content( format => 'text' )*\nReturns a text-only version of the page, with all HTML markup stripped. This feature requires\n*HTML::TreeBuilder* version 5 or higher to be installed, or a fatal error will be thrown. This\nworks only if the contents are HTML.\n\n*$mech->content( basehref => [$basehref|undef] )*\nReturns the HTML document, modified to contain a \"<base href=\"$basehref\">\" mark-up in the\nheader. *$basehref* is \"$mech->base()\" if not specified. This is handy to pass the HTML to\ne.g. HTML::Display. This works only if the contents are HTML.\n\n*$mech->content( raw => 1 )*\nReturns \"$self->response()->content()\", i.e. the raw contents from the response.\n\n*$mech->content( decodedbyheaders => 1 )*\nReturns the content after applying all \"Content-Encoding\" headers but with not additional\nmangling.\n\n*$mech->content( charset => $charset )*\nReturns \"$self->response()->decodedcontent(charset => $charset)\" (see HTTP::Response for\ndetails).\n\nTo preserve backwards compatibility, additional parameters will be ignored unless none of \"raw |\ndecodedbyheaders | charset\" is specified and the text is HTML, in which case an error will be\ntriggered.\n\nA fresh instance of WWW::Mechanize will return \"undef\" when \"$mech->content()\" is called,\nbecause no content is present before a request has been made.\n\n$mech->text()\nReturns the text of the current HTML content. If the content isn't HTML, $mech will die.\n\nThe text is extracted by parsing the content, and then the extracted text is cached, so don't\nworry about performance of calling this repeatedly.\n",
            "subsections": []
        },
        "LINK METHODS": {
            "content": "$mech->links()\nLists all the links on the current page. Each link is a WWW::Mechanize::Link object. In list\ncontext, returns a list of all links. In scalar context, returns an array reference of all\nlinks.\n\n$mech->followlink(...)\nFollows a specified link on the page. You specify the match to be found using the same params\nthat \"findlink()\" uses.\n\nHere some examples:\n\n*   3rd link called \"download\"\n\n$mech->followlink( text => 'download', n => 3 );\n\n*   first link where the URL has \"download\" in it, regardless of case:\n\n$mech->followlink( urlregex => qr/download/i );\n\nor\n\n$mech->followlink( urlregex => qr/(?i:download)/ );\n\n*   3rd link on the page\n\n$mech->followlink( n => 3 );\n\n*   the link with the url\n\n$mech->followlink( url => '/other/page' );\n\nor\n\n$mech->followlink( url => 'http://example.com/page' );\n\nReturns the result of the \"GET\" method (an HTTP::Response object) if a link was found.\n\nIf the page has no links, or the specified link couldn't be found, returns \"undef\". If\n\"autocheck\" is enabled an exception will be thrown instead.\n\n$mech->findlink( ... )\nFinds a link in the currently fetched page. It returns a WWW::Mechanize::Link object which\ndescribes the link. (You'll probably be most interested in the \"url()\" property.) If it fails to\nfind a link it returns undef.\n\nYou can take the URL part and pass it to the \"get()\" method. If that's your plan, you might as\nwell use the \"followlink()\" method directly, since it does the \"get()\" for you automatically.\n\nNote that \"<FRAME SRC=\"...\">\" tags are parsed out of the HTML and treated as links so this\nmethod works with them.\n\nYou can select which link to find by passing in one or more of these key/value pairs:\n\n*   \"text => 'string',\" and \"textregex => qr/regex/,\"\n\n\"text\" matches the text of the link against *string*, which must be an exact match. To\nselect a link with text that is exactly \"download\", use\n\n$mech->findlink( text => 'download' );\n\n\"textregex\" matches the text of the link against *regex*. To select a link with text that\nhas \"download\" anywhere in it, regardless of case, use\n\n$mech->findlink( textregex => qr/download/i );\n\nNote that the text extracted from the page's links are trimmed. For example, \"<a> foo </a>\"\nis stored as 'foo', and searching for leading or trailing spaces will fail.\n\n*   \"url => 'string',\" and \"urlregex => qr/regex/,\"\n\nMatches the URL of the link against *string* or *regex*, as appropriate. The URL may be a\nrelative URL, like foo/bar.html, depending on how it's coded on the page.\n\n*   \"urlabs => string\" and \"urlabsregex => regex\"\n\nMatches the absolute URL of the link against *string* or *regex*, as appropriate. The URL\nwill be an absolute URL, even if it's relative in the page.\n\n*   \"name => string\" and \"nameregex => regex\"\n\nMatches the name of the link against *string* or *regex*, as appropriate.\n\n*   \"rel => string\" and \"relregex => regex\"\n\nMatches the rel of the link against *string* or *regex*, as appropriate. This can be used to\nfind stylesheets, favicons, or links the author of the page does not want bots to follow.\n\n*   \"id => string\" and \"idregex => regex\"\n\nMatches the attribute 'id' of the link against *string* or *regex*, as appropriate.\n\n*   \"class => string\" and \"classregex => regex\"\n\nMatches the attribute 'class' of the link against *string* or *regex*, as appropriate.\n\n*   \"tag => string\" and \"tagregex => regex\"\n\nMatches the tag that the link came from against *string* or *regex*, as appropriate. The\n\"tagregex\" is probably most useful to check for more than one tag, as in:\n\n$mech->findlink( tagregex => qr/^(a|frame)$/ );\n\nThe tags and attributes looked at are defined below.\n\nIf \"n\" is not specified, it defaults to 1. Therefore, if you don't specify any params, this\nmethod defaults to finding the first link on the page.\n\nNote that you can specify multiple text or URL parameters, which will be ANDed together. For\nexample, to find the first link with text of \"News\" and with \"cnn.com\" in the URL, use:\n\n$mech->findlink( text => 'News', urlregex => qr/cnn\\.com/ );\n\nThe return value is a reference to an array containing a WWW::Mechanize::Link object for every\nlink in \"$self->content\".\n\nThe links come from the following:\n\n\"<a href=...>\"\n\"<area href=...>\"\n\"<frame src=...>\"\n\"<iframe src=...>\"\n\"<link href=...>\"\n\"<meta content=...>\"\n\n$mech->findalllinks( ... )\nReturns all the links on the current page that match the criteria. The method for specifying\nlink criteria is the same as in \"findlink()\". Each of the links returned is a\nWWW::Mechanize::Link object.\n\nIn list context, \"findalllinks()\" returns a list of the links. Otherwise, it returns a\nreference to the list of links.\n\n\"findalllinks()\" with no parameters returns all links in the page.\n\n$mech->findallinputs( ... criteria ... )",
            "subsections": [
                {
                    "name": "find_all_inputs",
                    "content": "properties match all of the regexes passed in. The controls returned are all descended from\nHTML::Form::Input. See \"INPUTS\" in HTML::Form for details.\n\nIf no criteria are passed, all inputs will be returned.\n\nIf there is no current page, there is no form on the current page, or there are no submit\ncontrols in the current form then the return will be an empty array.\n\nYou may use a regex or a literal string:\n\n# get all textarea controls whose names begin with \"customer\"\nmy @customertextinputs = $mech->findallinputs(\ntype       => 'textarea',\nnameregex => qr/^customer/,\n);\n\n# get all text or textarea controls called \"customer\"\nmy @customertextinputs = $mech->findallinputs(\ntyperegex => qr/^(text|textarea)$/,\nname       => 'customer',\n);\n\n$mech->findallsubmits( ... criteria ... )\n\"findallsubmits()\" does the same thing as \"findallinputs()\" except that it only returns\ncontrols that are submit controls, ignoring other types of input controls like text and\ncheckboxes.\n"
                }
            ]
        },
        "IMAGE METHODS": {
            "content": "$mech->images\nLists all the images on the current page. Each image is a WWW::Mechanize::Image object. In list\ncontext, returns a list of all images. In scalar context, returns an array reference of all\nimages.\n\n$mech->findimage()\nFinds an image in the current page. It returns a WWW::Mechanize::Image object which describes\nthe image. If it fails to find an image it returns undef.\n\nYou can select which image to find by passing in one or more of these key/value pairs:\n\n*   \"alt => 'string'\" and \"altregex => qr/regex/\"\n\n\"alt\" matches the ALT attribute of the image against *string*, which must be an exact match.\nTo select a image with an ALT tag that is exactly \"download\", use\n\n$mech->findimage( alt => 'download' );\n\n\"altregex\" matches the ALT attribute of the image against a regular expression. To select\nan image with an ALT attribute that has \"download\" anywhere in it, regardless of case, use\n\n$mech->findimage( altregex => qr/download/i );\n\n*   \"url => 'string'\" and \"urlregex => qr/regex/\"\n\nMatches the URL of the image against *string* or *regex*, as appropriate. The URL may be a\nrelative URL, like foo/bar.html, depending on how it's coded on the page.\n\n*   \"urlabs => string\" and \"urlabsregex => regex\"\n\nMatches the absolute URL of the image against *string* or *regex*, as appropriate. The URL\nwill be an absolute URL, even if it's relative in the page.\n\n*   \"tag => string\" and \"tagregex => regex\"\n\nMatches the tag that the image came from against *string* or *regex*, as appropriate. The\n\"tagregex\" is probably most useful to check for more than one tag, as in:\n\n$mech->findimage( tagregex => qr/^(img|input)$/ );\n\nThe tags supported are \"<img>\" and \"<input>\".\n\n*   \"id => string\" and \"idregex => regex\"\n\n\"id\" matches the id attribute of the image against *string*, which must be an exact match.\nTo select an image with the exact id \"download-image\", use\n\n$mech->findimage( id => 'download-image' );\n\n\"idregex\" matches the id attribute of the image against a regular expression. To select the\nfirst image with an id that contains \"download\" anywhere in it, use\n\n$mech->findimage( idregex => qr/download/ );\n\n*   \"classs => string\" and \"classregex => regex\"\n\n\"class\" matches the class attribute of the image against *string*, which must be an exact\nmatch. To select an image with the exact class \"img-fuid\", use\n\n$mech->findimage( class => 'img-fluid' );\n\nTo select an image with the class attribute \"rounded float-left\", use\n\n$mech->findimage( class => 'rounded float-left' );\n\nNote that the classes have to be matched as a complete string, in the exact order they\nappear in the website's source code.\n\n\"classregex\" matches the class attribute of the image against a regular expression. Use\nthis if you want a partial class name, or if an image has several classes, but you only care\nabout one.\n\nTo select the first image with the class \"rounded\", where there are multiple images that\nmight also have either class \"float-left\" or \"float-right\", use\n\n$mech->findimage( classregex => qr/\\brounded\\b/ );\n\nSelecting an image with multiple classes where you do not care about the order they appear\nin the website's source code is not currently supported.\n\nIf \"n\" is not specified, it defaults to 1. Therefore, if you don't specify any params, this\nmethod defaults to finding the first image on the page.\n\nNote that you can specify multiple ALT or URL parameters, which will be ANDed together. For\nexample, to find the first image with ALT text of \"News\" and with \"cnn.com\" in the URL, use:\n\n$mech->findimage( image => 'News', urlregex => qr/cnn\\.com/ );\n\nThe return value is a reference to an array containing a WWW::Mechanize::Image object for every\nimage in \"$self->content\".\n\n$mech->findallimages( ... )\nReturns all the images on the current page that match the criteria. The method for specifying\nimage criteria is the same as in \"findimage()\". Each of the images returned is a\nWWW::Mechanize::Image object.\n\nIn list context, \"findallimages()\" returns a list of the images. Otherwise, it returns a\nreference to the list of images.\n\n\"findallimages()\" with no parameters returns all images in the page.\n",
            "subsections": []
        },
        "FORM METHODS": {
            "content": "These methods let you work with the forms on a page. The idea is to choose a form that you'll\nlater work with using the field methods below.\n\n$mech->forms\nLists all the forms on the current page. Each form is an HTML::Form object. In list context,\nreturns a list of all forms. In scalar context, returns an array reference of all forms.\n\n$mech->formnumber($number)\nSelects the *number*th form on the page as the target for subsequent calls to \"field()\" and\n\"click()\". Also returns the form that was selected.\n\nIf it is found, the form is returned as an HTML::Form object and set internally for later use\nwith Mech's form methods such as \"field()\" and \"click()\". When called in a list context, the\nnumber of the found form is also returned as a second value.\n\nEmits a warning and returns undef if no form is found.\n\nThe first form is number 1, not zero.\n\n$mech->formname( $name )\nSelects a form by name. If there is more than one form on the page with that name, then the\nfirst one is used, and a warning is generated.\n\nIf it is found, the form is returned as an HTML::Form object and set internally for later use\nwith Mech's form methods such as \"field()\" and \"click()\".\n\nReturns undef if no form is found.\n\n$mech->formid( $id )\nSelects a form by ID. If there is more than one form on the page with that ID, then the first\none is used, and a warning is generated.\n\nIf it is found, the form is returned as an HTML::Form object and set internally for later use\nwith Mech's form methods such as \"field()\" and \"click()\".\n\nIf no form is found it returns \"undef\". This will also trigger a warning, unless \"quiet\" is\nenabled.\n\n$mech->allformswithfields( @fields )\nSelects a form by passing in a list of field names it must contain. All matching forms (perhaps\nnone) are returned as a list of HTML::Form objects.\n\n$mech->formwithfields( @fields )\nSelects a form by passing in a list of field names it must contain. If there is more than one\nform on the page with that matches, then the first one is used, and a warning is generated.\n\nIf it is found, the form is returned as an HTML::Form object and set internally for later used\nwith Mech's form methods such as \"field()\" and \"click()\".\n\nReturns undef and emits a warning if no form is found.\n\nNote that this functionality requires libwww-perl 5.69 or higher.\n\n$mech->allformswith( $attr1 => $value1, $attr2 => $value2, ... )\nSearches for forms with arbitrary attribute/value pairs within the <form> tag. (Currently does\nnot work for attribute \"action\" due to implementation details of HTML::Form.) When given more\nthan one pair, all criteria must match. Using \"undef\" as value means that the attribute in\nquestion must not be present.\n\nAll matching forms (perhaps none) are returned as a list of HTML::Form objects.\n\n$mech->formwith( $attr1 => $value1, $attr2 => $value2, ... )\nSearches for forms with arbitrary attribute/value pairs within the <form> tag. (Currently does\nnot work for attribute \"action\" due to implementation details of HTML::Form.) When given more\nthan one pair, all criteria must match. Using \"undef\" as value means that the attribute in\nquestion must not be present.\n\nIf it is found, the form is returned as an HTML::Form object and set internally for later used\nwith Mech's form methods such as \"field()\" and \"click()\".\n\nReturns undef if no form is found.\n",
            "subsections": []
        },
        "FIELD METHODS": {
            "content": "These methods allow you to set the values of fields in a given form.\n\n$mech->field( $name, $value, $number )\n$mech->field( $name, \\@values, $number )\nGiven the name of a field, set its value to the value specified. This applies to the current\nform (as set by the \"formname()\" or \"formnumber()\" method or defaulting to the first form on\nthe page).\n\nThe optional *$number* parameter is used to distinguish between two fields with the same name.\nThe fields are numbered from 1.\n\n$mech->select($name, $value)\n$mech->select($name, \\@values)\nGiven the name of a \"select\" field, set its value to the value specified. If the field is not\n\"<select multiple>\" and the $value is an array, only the first value will be set. [Note: the\ndocumentation previously claimed that only the last value would be set, but this was incorrect.]\nPassing $value as a hash with an \"n\" key selects an item by number (e.g. \"{n => 3}\" or \"{n =>\n[2,4]}\"). The numbering starts at 1. This applies to the current form.\n\nIf you have a field with \"<select multiple>\" and you pass a single $value, then $value will be\nadded to the list of fields selected, without clearing the others. However, if you pass an array\nreference, then all previously selected values will be cleared.\n\nReturns true on successfully setting the value. On failure, returns false and calls\n\"$self->warn()\" with an error message.\n\n$mech->setfields( $name => $value ... )\nThis method sets multiple fields of the current form. It takes a list of field name and value\npairs. If there is more than one field with the same name, the first one found is set. If you\nwant to select which of the duplicate field to set, use a value which is an anonymous array\nwhich has the field value and its number as the 2 elements.\n\n# set the second foo field\n$mech->setfields( $name => [ 'foo', 2 ] );\n\nThe fields are numbered from 1.\n\nThis applies to the current form.\n\n$mech->setvisible( @criteria )\nThis method sets fields of the current form without having to know their names. So if you have a\nlogin screen that wants a username and password, you do not have to fetch the form and inspect\nthe source (or use the mech-dump utility, installed with WWW::Mechanize) to see what the field\nnames are; you can just say\n\n$mech->setvisible( $username, $password );\n\nand the first and second fields will be set accordingly. The method is called set*visible*\nbecause it acts only on visible fields; hidden form inputs are not considered. The order of the\nfields is the order in which they appear in the HTML source which is nearly always the order\nanyone viewing the page would think they are in, but some creative work with tables could change\nthat; caveat user.\n\nEach element in @criteria is either a field value or a field specifier. A field value is a\nscalar. A field specifier allows you to specify the *type* of input field you want to set and is\ndenoted with an arrayref containing two elements. So you could specify the first radio button\nwith\n\n$mech->setvisible( [ radio => 'KCRW' ] );\n\nField values and specifiers can be intermixed, hence\n\n$mech->setvisible( 'fred', 'secret', [ option => 'Checking' ] );\n\nwould set the first two fields to \"fred\" and \"secret\", and the *next* \"OPTION\" menu field to\n\"Checking\".\n\nThe possible field specifier types are: \"text\", \"password\", \"hidden\", \"textarea\", \"file\",\n\"image\", \"submit\", \"radio\", \"checkbox\" and \"option\".\n\n\"setvisible\" returns the number of values set.\n\n$mech->tick( $name, $value [, $set] )\n\"Ticks\" the first checkbox that has both the name and value associated with it on the current\nform. Dies if there is no named check box for that value. Passing in a false value as the third\noptional argument will cause the checkbox to be unticked.\n\n$mech->untick($name, $value)\nCauses the checkbox to be unticked. Shorthand for \"tick($name,$value,undef)\"\n\n$mech->value( $name [, $number] )\nGiven the name of a field, return its value. This applies to the current form.\n\nThe optional *$number* parameter is used to distinguish between two fields with the same name.\nThe fields are numbered from 1.\n\nIf the field is of type file (file upload field), the value is always cleared to prevent remote\nsites from downloading your local files. To upload a file, specify its file name explicitly.\n\n$mech->click( $button [, $x, $y] )\nHas the effect of clicking a button on the current form. The first argument is the name of the\nbutton to be clicked. The second and third arguments (optional) allow you to specify the (x,y)\ncoordinates of the click.\n\nIf there is only one button on the form, \"$mech->click()\" with no arguments simply clicks that\none button.\n\nReturns an HTTP::Response object.\n\n$mech->clickbutton( ... )\nHas the effect of clicking a button on the current form by specifying its attributes. The\narguments are a list of key/value pairs. Only one of name, id, number, input or value must be\nspecified in the keys.\n\nDies if no button is found.\n\n*   \"name => name\"\n\nClicks the button named *name* in the current form.\n\n*   \"id => id\"\n\nClicks the button with the id *id* in the current form.\n\n*   \"number => n\"\n\nClicks the *n*th button with type *submit* in the current form. Numbering starts at 1.\n\n*   \"value => value\"\n\nClicks the button with the value *value* in the current form.\n\n*   \"input => $inputobject\"\n\nClicks on the button referenced by $inputobject, an instance of HTML::Form::SubmitInput\nobtained e.g. from\n\n$mech->currentform()->findinput( undef, 'submit' )\n\n$inputobject must belong to the current form.\n\n*   \"x => x\"\n\n*   \"y => y\"\n\nThese arguments (optional) allow you to specify the (x,y) coordinates of the click.\n\n$mech->submit()\nSubmits the current form, without specifying a button to click. Actually, no button is clicked\nat all.\n\nReturns an HTTP::Response object.\n\nThis used to be a synonym for \"$mech->click( 'submit' )\", but is no longer so.\n\n$mech->submitform( ... )\nThis method lets you select a form from the previously fetched page, fill in its fields, and\nsubmit it. It combines the \"formnumber\"/\"formname\", \"setfields\" and \"click\" methods into one\nhigher level call. Its arguments are a list of key/value pairs, all of which are optional.\n\n*   \"fields => \\%fields\"\n\nSpecifies the fields to be filled in the current form.\n\n*   \"withfields => \\%fields\"\n\nProbably all you need for the common case. It combines a smart form selector and data\nsetting in one operation. It selects the first form that contains all fields mentioned in\n\"\\%fields\". This is nice because you don't need to know the name or number of the form to do\nthis.\n\n(calls \"formwithfields()\" and \"setfields()\").\n\nIf you choose \"withfields\", the \"fields\" option will be ignored. The \"formnumber\",\n\"formname\" and \"formid\" options will still be used. An exception will be thrown unless\nexactly one form matches all of the provided criteria.\n\n*   \"formnumber => n\"\n\nSelects the *n*th form (calls \"formnumber()\". If this param is not specified, the\ncurrently-selected form is used.\n\n*   \"formname => name\"\n\nSelects the form named *name* (calls \"formname()\")\n\n*   \"formid => ID\"\n\nSelects the form with ID *ID* (calls \"formid()\")\n\n*   \"button => button\"\n\nClicks on button *button* (calls \"click()\")\n\n*   \"x => x, y => y\"\n\nSets the x or y values for \"click()\"\n\n*   \"strictforms => bool\"\n\nSets the HTML::Form strict flag which causes form submission to croak if any of the passed\nfields don't exist on the page, and/or a value doesn't exist in a select element. By default\nHTML::Form sets this value to false.\n\nThis behavior can also be turned on globally by passing \"strictforms => 1\" to\n\"WWW::Mechanize->new\". If you do that, you can still disable it for individual calls by\npassing \"strictforms => 0\" here.\n\nIf no form is selected, the first form found is used.\n\nIf *button* is not passed, then the \"submit()\" method is used instead.\n\nIf you want to submit a file and get its content from a scalar rather than a file in the\nfilesystem, you can use:\n\n$mech->submitform(withfields => { logfile => [ [ undef, 'whatever', Content => $content ], 1 ] } );\n\nReturns an HTTP::Response object.\n",
            "subsections": []
        },
        "MISCELLANEOUS METHODS": {
            "content": "$mech->addheader( name => $value [, name => $value... ] )\nSets HTTP headers for the agent to add or remove from the HTTP request.\n\n$mech->addheader( Encoding => 'text/klingon' );\n\nIf a *value* is \"undef\", then that header will be removed from any future requests. For example,\nto never send a Referer header:\n\n$mech->addheader( Referer => undef );\n\nIf you want to delete a header, use \"deleteheader\".\n\nReturns the number of name/value pairs added.\n\nNOTE: This method was very different in WWW::Mechanize before 1.00. Back then, the headers were\nstored in a package hash, not as a member of the object instance. Calling \"addheader()\" would\nmodify the headers for every WWW::Mechanize object, even after your object no longer existed.\n\n$mech->deleteheader( name [, name ... ] )\nRemoves HTTP headers from the agent's list of special headers. For instance, you might need to\ndo something like:\n\n# Don't send a Referer for this URL\n$mech->addheader( Referer => undef );\n\n# Get the URL\n$mech->get( $url );\n\n# Back to the default behavior\n$mech->deleteheader( 'Referer' );\n\n$mech->quiet(true/false)\nAllows you to suppress warnings to the screen.\n\n$mech->quiet(0); # turns on warnings (the default)\n$mech->quiet(1); # turns off warnings\n$mech->quiet();  # returns the current quietness status\n\n$mech->stackdepth( $maxdepth )\nGet or set the page stack depth. Use this if you're doing a lot of page scraping and running out\nof memory.\n\nA value of 0 means \"no history at all.\" By default, the max stack depth is humongously large,\neffectively keeping all history.\n\n$mech->savecontent( $filename, %opts )\nDumps the contents of \"$mech->content\" into *$filename*. *$filename* will be overwritten. Dies\nif there are any errors.\n\nIf the content type does not begin with \"text/\", then the content is saved in binary mode (i.e.\n\"binmode()\" is set on the output filehandle).\n\nAdditional arguments can be passed as *key*/*value* pairs:\n\n*$mech->savecontent( $filename, binary => 1 )*\nFilehandle is set with \"binmode\" to \":raw\" and contents are taken calling\n\"$self->content(decodedbyheaders => 1)\". Same as calling:\n\n$mech->savecontent( $filename, binmode => ':raw',\ndecodedbyheaders => 1 );\n\nThis *should* be the safest way to save contents verbatim.\n\n*$mech->savecontent( $filename, binmode => $binmode )*\nFilehandle is set to binary mode. If $binmode begins with ':', it is passed as a parameter\nto \"binmode\":\n\nbinmode $fh, $binmode;\n\notherwise the filehandle is set to binary mode if $binmode is true:\n\nbinmode $fh;\n\n*all other arguments*\nare passed as-is to \"$mech->content(%opts)\". In particular, \"decodedbyheaders\" might come\nhandy if you want to revert the effect of line compression performed by the web server but\nwithout further interpreting the contents (e.g. decoding it according to the charset).\n\n$mech->dumpheaders( [$fh] )\nPrints a dump of the HTTP response headers for the most recent response. If *$fh* is not\nspecified or is undef, it dumps to STDOUT.\n\nUnlike the rest of the dump* methods, $fh can be a scalar. It will be used as a file name.\n\n$mech->dumplinks( [[$fh], $absolute] )\nPrints a dump of the links on the current page to *$fh*. If *$fh* is not specified or is undef,\nit dumps to STDOUT.\n\nIf *$absolute* is true, links displayed are absolute, not relative.\n\n$mech->dumpimages( [[$fh], $absolute] )\nPrints a dump of the images on the current page to *$fh*. If *$fh* is not specified or is undef,\nit dumps to STDOUT.\n\nIf *$absolute* is true, links displayed are absolute, not relative.\n\nThe output will include empty lines for images that have no \"src\" attribute and therefore no\n\"<-\"url>>.\n\n$mech->dumpforms( [$fh] )\nPrints a dump of the forms on the current page to *$fh*. If *$fh* is not specified or is undef,\nit dumps to STDOUT. Running the following:\n\nmy $mech = WWW::Mechanize->new();\n$mech->get(\"https://www.google.com/\");\n$mech->dumpforms;\n\nwill print:\n\nGET https://www.google.com/search [f]\nie=ISO-8859-1                  (hidden readonly)\nhl=en                          (hidden readonly)\nsource=hp                      (hidden readonly)\nbiw=                           (hidden readonly)\nbih=                           (hidden readonly)\nq=                             (text)\nbtnG=Google Search             (submit)\nbtnI=I'm Feeling Lucky         (submit)\ngbv=1                          (hidden readonly)\n\n$mech->dumptext( [$fh] )\nPrints a dump of the text on the current page to *$fh*. If *$fh* is not specified or is undef,\nit dumps to STDOUT.\n\nOVERRIDDEN LWP::UserAgent METHODS\n$mech->clone()\nClone the mech object. The clone will be using the same cookie jar as the original mech.\n\n$mech->redirectok()\nAn overloaded version of \"redirectok()\" in LWP::UserAgent. This method is used to determine\nwhether a redirection in the request should be followed.\n\nNote that WWW::Mechanize's constructor pushes POST on to the agent's \"requestsredirectable\"\nlist.\n\n$mech->request( $request [, $arg [, $size]])\nOverloaded version of \"request()\" in LWP::UserAgent. Performs the actual request. Normally, if\nyou're using WWW::Mechanize, it's because you don't want to deal with this level of stuff\nanyway.\n\nNote that $request will be modified.\n\nReturns an HTTP::Response object.\n\n$mech->updatehtml( $html )\nAllows you to replace the HTML that the mech has found. Updates the forms and links parse-trees\nthat the mech uses internally.\n\nSay you have a page that you know has malformed output, and you want to update it so the links\ncome out correctly:\n\nmy $html = $mech->content;\n$html =~ s[</option>.{0,3}</td>][</option></select></td>]isg;\n$mech->updatehtml( $html );\n\nThis method is also used internally by the mech itself to update its own HTML content when\nloading a page. This means that if you would like to *systematically* perform the above HTML\nsubstitution, you would overload *updatehtml* in a subclass thusly:\n\npackage MyMech;\nuse base 'WWW::Mechanize';\n\nsub updatehtml {\nmy ($self, $html) = @;\n$html =~ s[</option>.{0,3}</td>][</option></select></td>]isg;\n$self->WWW::Mechanize::updatehtml( $html );\n}\n\nIf you do this, then the mech will use the tidied-up HTML instead of the original both when\nparsing for its own needs, and for returning to you through \"content()\".\n\nOverloading this method is also the recommended way of implementing extra validation steps (e.g.\nlink checkers) for every HTML page received. \"warn\" and \"die\" would then come in handy to signal\nvalidation errors.\n\n$mech->credentials( $username, $password )\nProvide credentials to be used for HTTP Basic authentication for all sites and realms until\nfurther notice.\n\nThe four argument form described in LWP::UserAgent is still supported.\n\n$mech->getbasiccredentials( $realm, $uri, $isproxy )\nReturns the credentials for the realm and URI.\n\n$mech->clearcredentials()\nRemove any credentials set up with \"credentials()\".\n\nINHERITED UNCHANGED LWP::UserAgent METHODS\nAs a subclass of LWP::UserAgent, WWW::Mechanize inherits all of LWP::UserAgent's methods. Many\nof which are overridden or extended. The following methods are inherited unchanged. View the\nLWP::UserAgent documentation for their implementation descriptions.\n\nThis is not meant to be an inclusive list. LWP::UA may have added others.\n\n$mech->head()\nInherited from LWP::UserAgent.\n\n$mech->mirror()\nInherited from LWP::UserAgent.\n\n$mech->simplerequest()\nInherited from LWP::UserAgent.\n\n$mech->isprotocolsupported()\nInherited from LWP::UserAgent.\n\n$mech->preparerequest()\nInherited from LWP::UserAgent.\n\n$mech->progress()\nInherited from LWP::UserAgent.\n",
            "subsections": []
        },
        "INTERNAL-ONLY METHODS": {
            "content": "These methods are only used internally. You probably don't need to know about them.\n\n$mech->updatepage($request, $response)\nUpdates all internal variables in $mech as if $request was just performed, and returns\n$response. The page stack is not altered by this method, it is up to caller (e.g. \"request\") to\ndo that.\n\n$mech->modifyrequest( $req )\nModifies a HTTP::Request before the request is sent out, for both GET and POST requests.\n\nWe add a \"Referer\" header, as well as header to note that we can accept gzip encoded content, if\nCompress::Zlib is installed.\n\n$mech->makerequest()\nConvenience method to make it easier for subclasses like WWW::Mechanize::Cached to intercept the\nrequest.\n\n$mech->resetpage()\nResets the internal fields that track page parsed stuff.\n\n$mech->extractlinks()\nExtracts links from the content of a webpage, and populates the \"{links}\" property with\nWWW::Mechanize::Link objects.\n\n$mech->pushpagestack()\nThe agent keeps a stack of visited pages, which it can pop when it needs to go BACK and so on.\n\nThe current page needs to be pushed onto the stack before we get a new page, and the stack needs\nto be popped when BACK occurs.\n\nNeither of these take any arguments, they just operate on the $mech object.\n\nwarn( @messages )\nCentralized warning method, for diagnostics and non-fatal problems. Defaults to calling\n\"CORE::warn\", but may be overridden by setting \"onwarn\" in the constructor.\n\ndie( @messages )\nCentralized error method. Defaults to calling \"CORE::die\", but may be overridden by setting\n\"onerror\" in the constructor.\n",
            "subsections": []
        },
        "BEST PRACTICES": {
            "content": "The default settings can get you up and running quickly, but there are settings you can change\nin order to make your life easier.\n\nautocheck\n\"autocheck\" can save you the overhead of checking status codes for success. You may outgrow\nit as your needs get more sophisticated, but it's a safe option to start with.\n\nmy $agent = WWW::Mechanize->new( autocheck => 1 );\n\ncookiejar\nYou are encouraged to install Mozilla::PublicSuffix and use HTTP::CookieJar::LWP as your\ncookie jar. HTTP::CookieJar::LWP provides a better security model matching that of current\nWeb browsers when Mozilla::PublicSuffix is installed.\n\nuse HTTP::CookieJar::LWP ();\n\nmy $jar = HTTP::CookieJar::LWP->new;\nmy $agent = WWW::Mechanize->new( cookiejar => $jar );\n\nprotocolsallowed\nThis option is inherited directly from LWP::UserAgent. It may be used to allow arbitrary\nprotocols.\n\nmy $agent = WWW::Mechanize->new(\nprotocolsallowed => [ 'http', 'https' ]\n);\n\nThis will prevent you from inadvertently following URLs like \"file:///etc/passwd\"\n\nprotocolsforbidden\nThis option is also inherited directly from LWP::UserAgent. It may be used to deny arbitrary\nprotocols.\n\nmy $agent = WWW::Mechanize->new(\nprotocolsforbidden => [ 'file', 'mailto', 'ssh', ]\n);\n\nThis will prevent you from inadvertently following URLs like \"file:///etc/passwd\"\n\nstrictforms\nConsider turning on the \"strictforms\" option when you create a new Mech. This will perform\na helpful sanity check on form fields every time you are submitting a form, which can save\nyou a lot of debugging time.\n\nmy $agent = WWW::Mechanize->new( strictforms => 1 );\n\nIf you do not want to have this option globally, you can still turn it on for individual\nforms.\n\n$agent->submitform( fields => { foo => 'bar' } , strictforms => 1 );\n\nWWW::MECHANIZE'S GIT REPOSITORY\nWWW::Mechanize is hosted at GitHub.\n\nRepository: <https://github.com/libwww-perl/WWW-Mechanize>. Bugs:\n<https://github.com/libwww-perl/WWW-Mechanize/issues>.\n",
            "subsections": []
        },
        "OTHER DOCUMENTATION": {
            "content": "*Spidering Hacks*, by Kevin Hemenway and Tara Calishain\n*Spidering Hacks* from O'Reilly (<http://www.oreilly.com/catalog/spiderhks/>) is a great book\nfor anyone wanting to know more about screen-scraping and spidering.\n\nThere are six hacks that use Mech or a Mech derivative:\n\n#21 WWW::Mechanize 101\n#22 Scraping with WWW::Mechanize\n#36 Downloading Images from Webshots\n#44 Archiving Yahoo! Groups Messages with WWW::Yahoo::Groups\n#64 Super Author Searching\n#73 Scraping TV Listings\n\nThe book was also positively reviewed on Slashdot:\n<http://books.slashdot.org/article.pl?sid=03/12/11/2126256>\n",
            "subsections": []
        },
        "ONLINE RESOURCES AND SUPPORT": {
            "content": "*   WWW::Mechanize mailing list\n\nThe Mech mailing list is at <http://groups.google.com/group/www-mechanize-users> and is\nspecific to Mechanize, unlike the LWP mailing list below. Although it is a users list, all\ndevelopment discussion takes place here, too.\n\n*   LWP mailing list\n\nThe LWP mailing list is at <http://lists.perl.org/showlist.cgi?name=libwww>, and is more\nuser-oriented and well-populated than the WWW::Mechanize list.\n\n*   Perlmonks\n\n<http://perlmonks.org> is an excellent community of support, and many questions about Mech\nhave already been answered there.\n\n*   WWW::Mechanize::Examples\n\nA random array of examples submitted by users, included with the Mechanize distribution.\n\nARTICLES ABOUT WWW::MECHANIZE\n*   <http://www.ibm.com/developerworks/linux/library/wa-perlsecure/>\n\nIBM article \"Secure Web site access with Perl\"\n\n*   <http://www.oreilly.com/catalog/googlehks2/chapter/hack84.pdf>\n\nLeland Johnson's hack #84 in *Google Hacks, 2nd Edition* is an example of a production\nscript that uses WWW::Mechanize and HTML::TableContentParser. It takes in keywords and\nreturns the estimated price of these keywords on Google's AdWords program.\n\n*   <http://www.perl.com/pub/a/2004/06/04/recorder.html>\n\nLinda Julien writes about using HTTP::Recorder to create WWW::Mechanize scripts.\n\n*   <http://www.developer.com/lang/other/article.php/3454041>\n\nJason Gilmore's article on using WWW::Mechanize for scraping sales information from Amazon\nand eBay.\n\n*   <http://www.perl.com/pub/a/2003/01/22/mechanize.html>\n\nChris Ball's article about using WWW::Mechanize for scraping TV listings.\n\n*   <http://www.stonehenge.com/merlyn/LinuxMag/col47.html>\n\nRandal Schwartz's article on scraping Yahoo News for images. It's already out of date: He\nmanually walks the list of links hunting for matches, which wouldn't have been necessary if\nthe \"findlink()\" method existed at press time.\n\n*   <http://www.perladvent.org/2002/16th/>\n\nWWW::Mechanize on the Perl Advent Calendar, by Mark Fowler.\n\n*   <http://www.linux-magazin.de/ausgaben/2004/03/datenruessel/>\n\nMichael Schilli's article on Mech and WWW::Mechanize::Shell for the German magazine *Linux\nMagazin*.\n",
            "subsections": [
                {
                    "name": "Other modules that use Mechanize",
                    "content": "Here are modules that use or subclass Mechanize. Let me know of any others:\n\n*   Finance::Bank::LloydsTSB\n\n*   HTTP::Recorder\n\nActs as a proxy for web interaction, and then generates WWW::Mechanize scripts.\n\n*   Win32::IE::Mechanize\n\nJust like Mech, but using Microsoft Internet Explorer to do the work.\n\n*   WWW::Bugzilla\n\n*   WWW::Google::Groups\n\n*   WWW::Hotmail\n\n*   WWW::Mechanize::Cached\n\n*   WWW::Mechanize::Cached::GZip\n\n*   WWW::Mechanize::FormFiller\n\n*   WWW::Mechanize::Shell\n\n*   WWW::Mechanize::Sleepy\n\n*   WWW::Mechanize::SpamCop\n\n*   WWW::Mechanize::Timed\n\n*   WWW::SourceForge\n\n*   WWW::Yahoo::Groups\n\n*   WWW::Scripter\n"
                }
            ]
        },
        "ACKNOWLEDGEMENTS": {
            "content": "Thanks to the numerous people who have helped out on WWW::Mechanize in one way or another,\nincluding Kirrily Robert for the original \"WWW::Automate\", Lyle Hopkins, Damien Clark, Ansgar\nBurchardt, Gisle Aas, Jeremy Ary, Hilary Holz, Rafael Kitover, Norbert Buchmuller, Dave Page,\nDavid Sainty, H.Merijn Brand, Matt Lawrence, Michael Schwern, Adriano Ferreira, Miyagawa,\nPeteris Krumins, Rafael Kitover, David Steinbrunner, Kevin Falcone, Mike O'Regan, Mark Stosberg,\nUri Guttman, Peter Scott, Philippe Bruhat, Ian Langworth, John Beppu, Gavin Estey, Jim Brandt,\nAsk Bjoern Hansen, Greg Davies, Ed Silva, Mark-Jason Dominus, Autrijus Tang, Mark Fowler, Stuart\nChildren, Max Maischein, Meng Wong, Prakash Kailasa, Abigail, Jan Pazdziora, Dominique\nQuatravaux, Scott Lanning, Rob Casey, Leland Johnson, Joshua Gatcomb, Julien Beasley, Abe\nTimmerman, Peter Stevens, Pete Krawczyk, Tad McClellan, and the late great Iain Truskett.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Andy Lester <andy at petdance.com>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2004 by Andy Lester.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "WWW::Mechanize - Handy web browsing in a Perl object",
    "flags": [],
    "examples": [],
    "see_also": []
}