#!/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; } #### One 7117 #### #!/usr/bin/perl use strict; use warnings; use Mojo::UserAgent; use feature 'say'; my $ua = Mojo::UserAgent->new; my $url = 'https://urlgoeshere'; my $dom = $ua->get( $url )->res->dom; foreach my $div ( $dom->find('div[.class^=i"grouped-item product-purchase-wrapper"]')->each ){ say $div->text; }