nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Web::Scraper module to scrape text. Given following HTML:
<p class="myClass">Blah Blah Blah </p>
Note the newlines in the paragraph. I'm trying to preserve the whitespace (newlines) when scraping with this line:
process '//p[contains(@class, "myClass")]', 'paragraph' => 'TEXT +',
This works but without newlines. I tried RAW instead of TEXT but still have the problem. I seem to remember there being a third option but I can't remember what it is. Thanks.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Preserving newlines with Web::Scraper
by haukex (Archbishop) on Dec 25, 2018 at 11:35 UTC | |
by nysus (Parson) on Dec 25, 2018 at 11:40 UTC | |
Re: Preserving newlines with Web::Scraper
by nysus (Parson) on Dec 25, 2018 at 11:38 UTC |
Back to
Seekers of Perl Wisdom