Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Working with source of returned web page

by Popcorn Dave (Abbot)
on Jun 10, 2008 at 03:30 UTC ( [id://691142]=note: print w/replies, xml ) Need Help??


in reply to Working with source of returned web page

If you've got the source of the page, you should feed it through something like Toke::HTMLParser to find the specific bit you're looking for.


Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

I would love to change the world, but they won't give me the source code

Replies are listed 'Best First'.
Re^2: Working with source of returned web page
by clone4 (Sexton) on Jun 10, 2008 at 20:39 UTC
    wow that's really handy, but when it comes to more specific strings, which aren't defined by any html tags, then it's necessary to use regex anyway...
    But still as I were saying very useful! Thanks again
      It's been a while since I used that module but if I recall correctly, it parses everything in to a token and the tokens not defined as an HTML tag should be defined as a text token.

      Take a look at HTML::TokeParser help - parsing headlines and you'll see a quick program I wrote to dump an HTML page to tokenized output. Run that on your page and I think you'll see you don't need to do the regex per se, but rather need to check text tokens to find what you're after.

      Good luck!

      Update: Changed link from scratchpad to node as per suggestion by ww


      Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

      I would love to change the world, but they won't give me the source code

Log In?
Username:
Password:

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

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

    No recent polls found