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?
In reply to Re-rendering web pages by rastoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |