#!/usr/bin/perl -w use HTML::LinkExtor; use LWP::Simple; use HTML::TreeBuilder::XPath; use Term::ProgressBar; my $url = "http://www.totalpolitics.com/blog/463546/senior-medics-call-on-uk-to-stay-but-brexiteers-have-more-to-cheer.thtml"; my $content = get $url; my $tree = HTML::TreeBuilder::XPath->new_from_content($content); my $title = $tree->findvalue(q{//div[@id="article"]/h1}); my $body = $tree->findvalue(q{//div[@class="article-body"]}); my $author = $tree->findnodes(q{//div[@class="article-body"]/p/strong}); $author = $author->[0]->getValue; $body =~ s/$author//; my $xml .= ''; $xml .= ''; $xml .= ''; $xml .= ''; $xml .= $url; $xml .= ''; $xml .= ''; $xml .= $title; $xml .= ''; $xml .= ''; $xml .= ""; $xml .= ''; $xml .= ''; $xml .= $author; $xml .= ''; $xml .= "\n"; $xml .= ""; print $xml;