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

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

Replies are listed 'Best First'.
Re^7: save http image data
by kcella (Beadle) on Oct 14, 2005 at 11:49 UTC
    By non-interactive I just mean as a background job where there are no visible windows. I have used the Win32::OLE approach already (which is what Win32::IE::Mechanize is based on) and even with full functionality, the only available function to save image data to disk for the corresponding MSDN SDK is ExecWB. After having done the research, I know this method does not work in Perl without popping up a SaveAs window and typing in the path. Through Win32::GuiTest, I have a hack that automates the typing of the path and saving it to disk, but it still requires a window to be present.

    I have looked at all the code samples that you references and provided, but it is not possible to have the saving of an image to disk and javascript support in the same module. The mirror method used in 'get-despair' is not supported by Win32::IE::Mechanize and neither are any of the methods to save non-HTML data to disk.

    The main problem is that some of the URL's for the images that I want to save are stored in a javascript variable which I need javascript support to access. If I use Win32::IE::Mechanize to decode the variable, I cannot use it to save the data. I will need the functionality from WWW::Mechanize. Unfortunatley, the site I am trying to browse requires a login and the instance of the Win32::IE::Mechanize object and the WWW::Mechanize object are considered different sessions, I cannot just pass the javascript URL to WWW::Mechanize and save to disk. I will need an active session in both to accomplish what I need.

    I have two versions of the program that work, but none of them are "clean". One involves a window propmt and the other involves keeping two sessions active. Does any of this help you better understand my problem?

    thanks,
    Kevin
      Hi Kevin,

      Thanks for clearing that up for me.
      Do you have an example html page that is visable to the public?
      The reason is I would like to play around with this when I am on Windows machine.

      Thanks

      Martin
        I'm not sure what you mean. If you want to use a page to test from, then you can just try www.google.com. When I test my code, I try and save the Google logo to disk. Outside of that, I don't know of any public sites that would mimic what I am doing without compromising a username and password.

        thanks,
        Kevin