in reply to Re: Harvesting and Parsing HTML from other sites
in thread Harvesting and Parsing HTML from other sites
marius I'm not sure that any of my regexes can get by without the /s modifier though, why did you say that?It's almost my one concession to the absolute vagueness of HTML practice that I use it. You're right about keeperlength, I failed to cut and paste that from the actual code, and yes, you're right about a hash being better. Just habit on my part, that "by twos" thing. Thanks.
davorg, yes, of course you're right. I think there's a psychological reason why people like me want to do it the "hard" way rather than using a module, but I've learnt something from this. I want to put on record my complete stupidity though, which will chime nicely with the "use a module, dummy" refrain.
My variable $html didn't revert at all, what happened in that I had an html file in which someone had foolishly put two titles, really far apart, so that when I did the
($pagetitle) = $html =~ /<TITLE>(.*)<\/TITLE>/sgi;
thing, it actually pulled out nearly the whole document!
The final output, as you can see, consisted of the title, then the document, but the title, due to the somewhat random HTML, was the document.
All I can do is apologise for wasting your time and try to get more sleep and be more sensible in future. And use
($pagetitle) = $html =~ /<TITLE>(.*?)<\/TITLE>/sgi;
instead... Your humble servant h17
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Harvesting and Parsing HTML from other sites
by marius (Hermit) on Mar 28, 2001 at 21:28 UTC |