WWW::Mechanize::Chrome::Node - represent a Chrome HTML node in Perl
(my $node) = $mech->selector('.download'); print $node->get_attribute('class'); # "download"
attributes
The attributes this node has
nodeName
The (tag) name of this node, with a namespace
localName
The local (tag) name of this node
backendNodeId
The id of this node within Chrome
objectId
Another id of this node within Chrome
driver
The Chrome::DevToolsProtocol::Transport instance used to communicate with Chrome
mech
A weak reference to the WWW::Mechanize::Chrome instance used to communicate with Chrome.
->nodeId
print $node->nodeId();
Lazily fetches the node id of this node
->get_attribute
print $node->get_attribute('outerHTML');
Fetches the attribute of the node from Chrome
->set_attribute
$node->set_attribute('href' => 'https://example.com');
Sets or creates an attribute of a node. To remove an attribute, pass in the attribute value as undef.
undef
Note that this invalidates the nodeId of every node so you may or may not need to refetch all other nodes or receive stale values.
nodeId
->get_tag_name
print $node->get_tag_name();
Fetches the tag name of this node
->get_text
print $node->get_text();
Returns the text of the node and the contained child nodes.
->set_text
$node->set_text("Hello World");
Sets the text of the node and the contained child nodes.
The public repository of this module is https://github.com/Corion/www-mechanize-chrome.
The public support forum of this module is https://perlmonks.org/.
I've given a German talk at GPW 2017, see http://act.yapc.eu/gpw2017/talk/7027 and https://corion.net/talks for the slides.
At The Perl Conference 2017 in Amsterdam, I also presented a talk, see http://act.perlconference.org/tpc-2017-amsterdam/talk/7022. The slides for the English presentation at TPCiA 2017 are at https://corion.net/talks/WWW-Mechanize-Chrome/www-mechanize-chrome.en.html.
Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Mechanize-Chrome or via mail to www-mechanize-Chrome-Bugs@rt.cpan.org.
Max Maischein corion@cpan.org
corion@cpan.org
Copyright 2010-2018 by Max Maischein corion@cpan.org.
This module is released under the same terms as Perl itself.
To install WWW::Mechanize::Chrome, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mechanize::Chrome
CPAN shell
perl -MCPAN -e shell install WWW::Mechanize::Chrome
For more information on module installation, please visit the detailed CPAN module installation guide.