akk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to save an image from the webpage (www.arabidopsis.org/servlets/TairObject?id=1501129457&type=locus). Using right click on image, I am able to save it as "image.png". However, I want to do this using PERL scripts. Although, I tried to do this using a PERL module Image::Grab, but this did not work which may be because the image as such has no direct link in the web page rather it is displayed through a different source using java scripts. Will somebody please let me know how to do this.

Replies are listed 'Best First'.
Re: image grab
by Corion (Patriarch) on Apr 26, 2010 at 08:11 UTC

    Most likely this is because, as you note, the page creates its content by using Javascript.

    The most lightweight approach would be to look at the Javascript source and extract the generated image URL from the Javascript source by using Perl.

    A robust approach would be to use a Javascript emulator like WWW::Scripter or a Javascript enabled browser like Firefox through WWW::Mechanize::Firefox and to save the image data after the page has been rewritten through Javascript.