WWW::Mechanize::Plugin::Selector - CSS selector method for WWW::Mechanize
This is a plugin (or "Role", for some) which supplies the ->selector method to your WWW::Mechanize object. It requires that the WWW::Mechanize object implements a corresponding ->xpath method, as WWW::Mechanize::Firefox and WWW::Mechanize::PhantomJS do.
->selector
->xpath
$mech->selector( $css_selector, %options )
my @text = $mech->selector('p.content');
Returns all nodes matching the given CSS selector. If $css_selector is an array reference, it returns all nodes matched by any of the CSS selectors in the array.
$css_selector
This takes the same options that ->xpath does.
If you are not using WWW::Mechanize::Pluggable, you can import this code in your module via the following:
use WWW::Mechanize::Plugin::Selector; { no warnings 'once'; *selector = \&WWW::Mechanize::Plugin::Selector::selector; }
The public repository of this module is https://github.com/Corion/www-mechanize-plugin-selector.
The public support forum of this module is https://perlmonks.org/.
Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Mechanize-Plugin-Selector or via mail to www-mechanize-plugin-selector-Bugs@rt.cpan.org.
Max Maischein corion@cpan.org
corion@cpan.org
Copyright 2010-2017 by Max Maischein corion@cpan.org.
This module is released under the same terms as Perl itself.
To install WWW::Mechanize::Plugin::Selector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mechanize::Plugin::Selector
CPAN shell
perl -MCPAN -e shell install WWW::Mechanize::Plugin::Selector
For more information on module installation, please visit the detailed CPAN module installation guide.