Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

www::mechanize::formfiller::value::random::date(3pm) [debian man page]

WWW::Mechanize::FormFiller::Value::Random::Date(3pm)	User Contributed Perl Documentation   WWW::Mechanize::FormFiller::Value::Random::Date(3pm)

NAME
WWW::Mechanize::FormFiller::Value::Random::Date - Fill a timestamp into an HTML form field SYNOPSIS
use WWW::Mechanize::FormFiller; use WWW::Mechanize::FormFiller::Value::Random::Date; my $f = WWW::Mechanize::FormFiller->new(); # Create a random value for the HTML field "born" my $born = WWW::Mechanize::FormFiller::Value::Random::Date->new( born => string => '%Y%m%d', min => '20000101', max => '20373112' ); $f->add_value( born => $born ); # Alternatively take the following shorthand, which adds the # field to the list as well : # If there is no password, put a random one out of the list there my $last_here = $f->add_filler( last_here => Random::Date => string => '%H%M%S', min => '000000', max => 'now'); DESCRIPTION
This class provides a way to write a randomly chosen value into a HTML field. new NAME, %ARGS Creates a new value which will correspond to the HTML field "NAME". The allowed %ARGS are string => POSIX strftime string min => minimum time stamp (inclusive) max => maximum time stamp (exclusive) The "min" and "max" time stamps must be in the same format as the "string" supplies. WARNING The algorithm to implement "min" and "max" barriers is very simplicistic - it tries as many random values as necessary to meet the two criteria. This means that your script may enter an infinite loop if the criteria can never be attained or are too little apart. name [NEWNAME] Gets and sets the name of the HTML field this value corresponds to. value FIELD Returns the value to put into the HTML field. EXPORT None by default. COPYRIGHT AND LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Copyright (C) 2002,2003 Max Maischein AUTHOR
Max Maischein, <corion@cpan.org> Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome ! SEE ALSO
Data::Random, WWW::Mechanize, WWW::Mechanize::Shell, WWW::Mechanize::FormFiller, WWW::Mechanize::FormFiller::Value::Value, WWW::Mechanize::FormFiller::Value::Default, WWW::Mechanize::FormFiller::Value::Fixed, WWW::Mechanize::FormFiller::Value::Interactive perl v5.10.1 2009-04-24 WWW::Mechanize::FormFiller::Value::Random::Date(3pm)

Check Out this Related Man Page

WWW::Mechanize::TreeBuilder(3pm)			User Contributed Perl Documentation			  WWW::Mechanize::TreeBuilder(3pm)

NAME
WWW::Mechanize::TreeBuilder - Module to optimize WWW::Mechanize and HTML::TreeBuilder use SYNOPSIS
use Test::More tests => 2; use Test::WWW::Mechanize; use WWW::Mechanize::TreeBuilder; # or # use WWW::Mechanize; # or # use Test::WWW::Mechanize::Catalyst 'MyApp'; my $mech = Test::WWW::Mechanize->new; # or #my $mech = Test::WWW::Mechanize::Catalyst->new; # etc. etc. WWW::Mechanize::TreeBuilder->meta->apply($mech); $mech->get_ok('/'); is( $mech->look_down(_tag => 'p')->as_trimmed_text, 'Some text', 'It worked' ); DESCRIPTION
This module combines WWW::Mechanize and HTML::TreeBuilder. Why? Because I've seen too much code like the following: like($mech->content, qr{<p>some text</p>}, "Found the right tag"); Which is just all flavours of wrong - its akin to processing XML with regexps. Instead, do it like the following: ok($mech->look_down(_tag => 'p', sub { $_[0]->as_trimmed_text eq 'some text' }) The anon-sub there is a bit icky, but this means that anyone should happen to add attributes to the "<p>" tag (such as an id or a class) it will still work and find the right tag. All of the methods available on HTML::Element (that aren't 'private' - i.e. that don't begin with an underscore) such as "look_down" or "find" are automatically delegated to "$mech->tree" through the magic of Moose. METHODS
Everything in WWW::Mechanize (or which ever sub class you apply it to) and all public methods from HTML::Element except those where WWW::Mechanize and HTML::Element overlap. In the case where the two classes both define a method, the one from WWW::Mechanize will be used (so that the existing behaviour of Mechanize doesn't break.) USING XPATH OR OTHER SUBCLASSES
HTML::TreeBuilder::XPath allows you to use use xpath selectors to select elements in the tree. You can use that module by providing parameters to the moose role: with 'WWW::Mechanize::TreeBuilder' => { tree_class => 'HTML::TreeBuilder::XPath' }; # or # NOTE: No hashref using this method WWW::Mechanize::TreeBuilder->meta->apply($mech, tree_class => 'HTML::TreeBuilder::XPath'; ); and class will be automatically loaded for you. This class will be used to construct the tree in the following manner: $tree = $tree_class->new_from_content($req->decoded_content)->elementify; You can also specify a "element_class" parameter which is the (HTML::Element sub)class that methods are proxied from. This module provides defaults for element_class when "tree_class" is "HTML::TreeBuilder" or "HTML::TreeBuilder::XPath" - it will warn otherwise. AUTHOR
Ash Berlin "<ash@cpan.org>" LICENSE
Same as Perl 5.8, or at your option any later version of Perl. perl v5.10.1 2010-12-16 WWW::Mechanize::TreeBuilder(3pm)
Man Page