Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Grab sections of text

by Fox (Pilgrim)
on Jan 13, 2010 at 18:02 UTC ( [id://817244]=note: print w/replies, xml ) Need Help??


in reply to Grab sections of text

I guess the problem is in the $s variable, looking in the source I see <center class=categories>, notice there's no quoting in "categories".

this works for me:
use LWP::Simple; $html = get "http://search.cpan.org/"; $s = '<center class=categories>'; $e = '</center>'; $txt = substr $html, index($html,$s), index($html,$e); print "$txt\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found