in reply to Re^2: save http image data
in thread save http image data

Yes. Actually I was already using Win32::OLE before with IE, but there was no way to save image data without having it being interactive.

It looks like I will have to use WWW::Mechanize to save data and then use IE::Mechanize for any javascript I need to handle. I was just hoping for a cleaner way to handle the save functionality.

Thanks for all the help, at least I now have some modules I can use that help make my code more concise.

thanks,
Kevin

Replies are listed 'Best First'.
Re^4: save http image data
by marto (Cardinal) on Oct 13, 2005 at 15:15 UTC
    Perhaps I am not picking up what you are saying properly.
    What is to stop you using Win32::IE::Mechanize to do all of this?

    You can use it to open an IE window:
    #!/usr/bin/perl use Win32::IE::Mechanize; my $ie = Win32::IE::Mechanize->new( visible => 0 ); # you wanted it no +t to be a visable window right?
    which will be able deal with the JavaScript.
    You could use the $ie->images method similarly to the way you were going to use WWW::Mechanize's $mech->images.
    If I am not understanding some part of the problem let me know.

    Hope this helps.

    Martin
      While getting all the images references in the current page is helpful, I need to save them to disk. There is no non-interactive way to do this with Win32::IE::Mechanize.

      $ie->get($url, ":content_file"=>$file);

      The above method does not work for image data. I also get an empty file if I do the following:
      open(OUT, ">$file");<br> print OUT $ie->content;<br> close(OUT);
      thanks,
      Kevin
        Kevin,

        "There is no non-interactive way to do this with Win32::IE::Mechanize."

        By 'non-interactive' do you mean you may have to code something by hand?
        Way back in this thread when I mentioned the examples did you look at any of them?
        With a little work I am sure you could mimic merlyns 'get-despair' example.
        Let me know how you get on

        Martin