Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Scraping HTML: orthodoxy and reality

by hsmyers (Canon)
on Jul 08, 2003 at 13:12 UTC ( #272266=note: print w/ replies, xml ) Need Help??


in reply to Scraping HTML: orthodoxy and reality

In almost any situation, there are those who prefer maxims to thinking---ignore them. With specific regard to the odd web scrape, there are a couple of things that can be a problem.

  • The need to handle nesting.
  • The need to survive arbitrary changes in the source.
The first can be handled by tight expression bounding or by using something like Text::DelimMatch or Text::Balanced. You manage the second by vigilance---patch it when needed.

As for those who knee jerk instead of thinking, since many of them have no experience witting parsers (formal or ad hoc) they fail to see that the regex approach is a form of parsing, just without the overhead of dealing with things that don't matter.

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."


Comment on Re: Scraping HTML: orthodoxy and reality

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2014-07-14 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (257 votes), past polls