my @elements = $driver->find_elements(".front > h1", "css"); foreach my $item(@elements){ print $item->get_text()."<\n"; }