![]() |
|
The stupid question is the question not asked | |
PerlMonks |
lwp diary: day 1by mkmcconn (Chaplain) |
on Jan 14, 2001 at 10:37 UTC ( #51712=perlquestion: print w/replies, xml ) | Need Help?? |
mkmcconn has asked for the wisdom of the Perl Monks concerning the following question: TodayI made my first attempt at using LWP. It actually started a few weeks ago, when I took 10 seconds to whip up a commandline that returns a printout of the vanity block on my home node.
That's pretty simple; and, the output is just what you would expect: User since: Mon Dec 4 at 20:46 Last here: Sat Jan 13 at 23:50 (54 minutes ago) Experience: 131 Level: scribe (4) Writeups: 11 Location: Portland, Oregon User's localtime: Sat Jan 13 at 18:14 Works swell. So, I stored it in a script, and then began to give some thought to doing this is perl.
Hardly a Perl script at that point but, from the commandline it was invoked like this:
laid out like that, it began to occur to me how much more powerful it could be, and how useful an exercise, if all the functionality were translated into Perl. My first attemptI was very surprised by the simplicity of LWP for simple tasks. Retrieving raw HTML is extraordinarily simple:But I don't want raw HTML. Seemingly not a problem. LWP includes the format method from HTML::FormatText.
This is where I encountered my obstacle. The output of the script above (as most of you already know), is this: TABLE NOT SHOWNTABLE NOT SHOWNTABLE NOT SHOWN This page brought to you by the crazy folks at The Everything Development Company and maintained by Tim Vroom Interested in Advertising? Contact our ad-meister, Robo HTML::Format does not handle the contents of tables. So, that's all the farther I got, today. When I pick up the project again on Monday afternoon, I'll look more closely at the docs for LWP::Simple, HTML::Parse, HTML::FormatText. There are numerous articles here on on Perl Monks. I also plan to look at Parse::RecDescent to see if its relevant to the task. The Perl Journal #17 is mentioned several times in Perl Monks articles - but, that site is very broken right now. Will the Contemplative Order of Perl Monks honor me with your wisdom, by which this lowly scribe might be brought more suddenly into the light? Brethren, if I ascend slopes of lofty Mt. CPAN, will I find my answer among the archives of the scriptures there? Or, is this an exercise in private meditation? wordily yours: mkmcconn
Back to
Seekers of Perl Wisdom
|
|