rastoboy has asked for the wisdom of the Perl Monks concerning the following question:
I'm pondering a project which would involve fetching random web pages and displaying them via CGI script. A most vexing puzzle for me has been how to do this elegantly.
For example, if I fetch the page via WWW::Mechanize, I need to look for all img tags, href's, and anything else using a relative path and prepend the base URL of the site to it, before passing it on to the browser, if I want it to look "right".
But this gets real complicated real fast when dealing with javascript, css, and other assorted unexpected references--not to mention sites that gaurd against others using their images. I've even contemplated taking a screenshot of the page, but even then the perl modules I found depend on X windows based tools like Mozilla or Webkit, and I really don't want to have X Windows on my Linux server at all (and also my project involves making relevant changes such as highlights or underlines on the fly).
Is there an elegant way to fetch a page, and re-display it reliably?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re-rendering web pages
by gmargo (Hermit) on Nov 28, 2009 at 16:52 UTC | |
by rastoboy (Monk) on Nov 29, 2009 at 05:57 UTC | |
by holli (Abbot) on Nov 29, 2009 at 06:58 UTC | |
|
Re: Re-rendering web pages
by WizardOfUz (Friar) on Nov 28, 2009 at 12:16 UTC | |
by afoken (Chancellor) on Nov 28, 2009 at 23:47 UTC | |
|
Re: Re-rendering web pages
by Anonymous Monk on Nov 28, 2009 at 13:05 UTC |