WWW::Me...e::Node(3)
πΈ NAME πΈ
okay so bestie, welcome to the manual page for WWW::Mechanize::Chrome::Node(3) π β a module that represents a Chrome HTML node in Perl. that's it. that's the whole job. it's a Perl object that is a node in your Chrome browser, and honestly? she ate. π
β¨ SYNOPSIS β¨
the entire vibe, in two (2) lines:
(my $node) = $mech->selector('.download');
print $node->get_attribute('class'); # "download"
so you grab a node with selector, and then you just... read stuff off it. that comment at the end? "download" β that's literally what it prints. no cap. π¦
π MEMBERS π
these are the lil fields your node is carrying around with her at all times, like a purse full of IDs:
π
"attributes"
the attributes this node has. all of them. the whole collection.
"nodeName"
the (tag) name of this node β with a namespace, so don't forget that part.
"nodeId"
the nodeId of this node.
"localName"
the local (tag) name of this node. yes, "local". it's giving lowercase energy.
"backendNodeId"
the id of this node within Chrome. π₯
"cachedNodeId"
the cached id of this node for this session β key detail bestie, it's per-session.
"objectId"
another id of this node within Chrome. (yes, another one. she contains multitudes.)
"driver"
the Chrome::DevToolsProtocol::Transport instance used to communicate with Chrome. that's the lil wire she talks through. β¨
"mech"
a weak reference to the WWW::Mechanize::Chrome instance used to communicate with Chrome.
β οΈ note the "weak" bestie β that's load-bearing, don't go swapping it for a strong ref and creating a cycle.
π§ CONSTRUCTORS π§
"fetchNode"
WWW::Mechanize::Chrome->fetchNode(
nodeId => $nodeId,
driver => $mech->driver,
)->get()
Returns a Future that returns a populated node. so you call ->get() on the future and boom π₯ β node acquired.
π METHODS π
"->get_attribute"
print $node->get_attribute('outerHTML');
Fetches the attribute of the node from Chrome.
print $node->get_attribute('href', live => 1);
Force a live query of the attribute to Chrome. if the attribute was declared on the node, this overrides the stored value and queries Chrome again for the current value of the attribute. fresh info only, periodt. π
"->set_attribute"
$node->set_attribute('href' => 'https://example.com');
Sets or creates an attribute of a node. want to remove an attribute? pass the attribute value in as undef. bye girl π
β οΈ important warning, fr fr: note that this invalidates the "nodeId" of every node β so you may or may not need to refetch all other nodes, or you might receive stale values. it's giving chaos. be careful. π
"->get_tag_name"
print $node->get_tag_name();
Fetches the tag name of this node. simple. iconic. π
"->get_text"
print $node->get_text();
Returns the text of the node and the contained child nodes. all of it. the whole family. π
"->set_text"
$node->set_text("Hello World");
Sets the text of the node and the contained child nodes. so "Hello World" goes in, and the kids come along for the ride. β¨
π REPOSITORY π
The public repository of this module is <https://github.com/Corion/www-mechanize-chrome>.
π«Ά SUPPORT π«Ά
The public support forum of this module is <https://perlmonks.org/>.
π€ TALKS π€
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>.
π BUG TRACKER π
Please report bugs in this module via the Github bug queue at <https://github.com/Corion/WWW-Mechanize-Chrome/issues>
π AUTHOR π
Max Maischein corion@cpan.org
β COPYRIGHT (c) β
Copyright 2010-2026 by Max Maischein corion@cpan.org.
π LICENSE π
This module is released under the same terms as Perl itself.
okay that's the whole page bestie, you're officially fluent π
this was documented as User Contributed Perl Documentation, running on perl v5.42.2, dated 2026-06-07 β and this lil remix of WWW::Mechanize::Chrome::Node(3) is clocking out. go fetch some nodes. slay. π¦β¨
π¦ where this page comes from
- fedora 43: perl-WWW-Mechanize-Chrome 0.78-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-WWW-Mechanize-Chrome 0.78-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms