Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: I want to save web pages as text rather than as HTML. -- oneliner

by anautismobserver (Sexton)
on Sep 11, 2019 at 19:18 UTC ( #11106030=note: print w/replies, xml ) Need Help??


in reply to Re: I want to save web pages as text rather than as HTML. -- oneliner
in thread I want to save web pages as text rather than as HTML.

Now I have Strawberry Perl up and running and the previous TreeBuilder code example now works (using 'http://perl.org' as input).

When I change the input to 'https://wordpress.com/read/feeds/94271045' using the following code:

use strict; use warnings; use LWP::UserAgent; use LWP::Simple; use HTML::TreeBuilder; print HTML::TreeBuilder->new_from_url('https://wordpress.com/read/feed +s/94271045')->as_text;

The output is << WordPress.comPlease enable JavaScript in your browser to enjoy WordPress.com. >>

Do you know how to fix this? One complicating factor is that pages like https://wordpress.com/read/feeds/94271045 won't display properly in my browser unless I'm logged into a WordPress account.

Thanks.

  • Comment on Re^2: I want to save web pages as text rather than as HTML. -- oneliner
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11106030]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2020-01-21 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?