I have an earlier post about web scraping images using Perl and the WWW::Mechanize family for web pages that get built using JavaScript after they are loaded. Obviously a lot of hurdles with are beyond my capabilities.

So I have a new thought but not sure it's possible, I'll describe what I believe may be a kludgy solution, which I'll gladly take at this point.

Please remember, I have my own Ubuntu server sitting somewhere, and I will run this script from any laptop with a web browser.

•Have my Perl script generate an HTML form of my own design, and then output it to my browser
•Make sure my Perl script does not exit here
•Have my Perl script generate the proper URL for the page I want to scrape
•Have my Perl script redirect to the URL from the above line and open that in either a new browser window or tab
•Now have my Perl script end

Then my idea is that I would go to the redirected window, manually "View Source", copy it, and post it to the form generated by the above Perl script.

If this kludgy idea was an entry in a cheese contest, it would not just be tagged the winner, but it would be so smelly that all the judges would run out while trying not to puke. However, is this possible?


In reply to Can my Perl CGI script open a new browser tab or window? by SergioQ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.