#!/usr/bin/perl use strict; use warnings; use Mojo::DOM; use feature 'say'; my $html = '
One
7117
'; my $dom = Mojo::DOM->new( $html ); # find each div with a class beginning grouped-item product-purchase-wrapper foreach my $div ( $dom->find('div[.class^=i"grouped-item product-purchase-wrapper"]')->each ){ say $div->text; }