#!/usr/bin/perl use strict; use warnings; use feature 'say'; use Mojo::DOM; my $html = '

Secondary bile acids (BAs) and short chain fatty acids (SCFAs), two major types of bacterial metabolites in the colon...

'; my $dom = Mojo::DOM->new( $html ); foreach my $abstract ( $dom->find('div.abstract-content > p')->each ){ say $abstract->text; }