Hi bt,
Hmm, that’s pretty weird. Have you tried printing @checkbox - is there really Selenium::Remote::WebElements inside? If you can provide a reproduction case (an entire perl script and a webpage that causes the error), that would be the most helpful. Otherwise, I probably can't help much; your script looks reasonable enough and I don't have enough information to do anything besides make bad random debugging guesses.
It probably isn’t any help, but the following works as expected over here:
use strict;
use warnings;
use feature qw/say/;
use Selenium::Chrome;
my $c = Selenium::Chrome->new;
$c->get('https://news.google.com');
my @elems = $c->find_elements('titletext', 'class');
say scalar @elems;
say $_->get_text for @elems;
$c->shutdown_binary;
# prints:
# 227
# Clinton, Trump hours away from historic debate battle
# Presidential Debate: New Polls Show Dead Heat Between Trump and Clinton
# Amid Super Bowl-level hype, Clinton and Trump face off in their first blockbuster presidential debate
# What time is the Presidential debate and how can I watch in the UK?
# Analysis: Donald Trump Would Win Election Today Based on Polling
# Clinton must work harder for the young black voters Trump is courting
# First Presidential Debate: Live Coverage
# ...
Good luck!
Similarly, to go through and click all the checkboxes, or a subset of, do you approach similarly?
Whoops, missed this part - but, yes, you’ve got the essence of it 100% correct.
my @elems = $driver->find_elements('checkbox', 'class');
for (@elems) {
if ($condition) {
$_->click;
}
}
Yes, I did check there were webelements...or at least hash looking things that appeared to be, but I will do it again.