use Web::Query::LibXML 'wq'; my $post_wrapper = wq('https://www.perl-community.de/bat/poard/thread/20750') ->find('div.author > a:contains("clms")') ->parent->parent; my $posting = $post_wrapper->find('.posting_content'); $posting->find('blockquote')->remove; my $post_text = $posting->text; my @permalinks; $post_wrapper->find('.anchor a')->each(sub { push @permalinks, $_->attr('href'); });