Occasionally I think of stupid hacks to accomplish things.
Most of the time I remind myself that they are stupid, and
they never see the light of day. But just to be silly I
will tell you a way that you can get your script to act
just like a browser, complete with proper handling of
frames, JavaScript, meta tags, cookies and the like.
Go find an http proxy in Perl. (merlyn's columns would
be a good place to start.) Modify it to parse the documents
passing through to find links in them.
(HTML::LinkExtor may help here.) Then set a copy of
IE to use that as your proxy server. Use the OLE modules
to drive IE around the web.
Voila! :-)
If you just need an answer to a question, this might be
acceptable. But I (obviously) wouldn't put this into
production. (Says the man who once had a temporary hack
which used IE to produce PDFs left in production for half
a year...)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.