Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^4: save image on web

by kcella (Beadle)
on Dec 22, 2004 at 00:51 UTC ( #416663=note: print w/replies, xml ) Need Help??

in reply to Re^3: save image on web
in thread save image on web

I tried WWW::Mechanize and it gave me a blank image. There is something in the web server daemon that is preventing me from downloading through a request/response. I can only save off the image if I do it manually. I was able to save the image by using a hack solution with Win32::GuiTest. The module allows me to automate key presses as if I were typing them.
use Win32::GuiTest qw(SendKeys); $IE->Navigate( $url ); <wait> SendKeys("%f$path~");
I wish to revisit the OLE automation and ExecWB command. I don't understand why this does not work. The following snippet should work, but it never saves the image unless I show the dialog and select the path manually.
$IE->Navigate( $url ); while( $IE->{Busy} ) { while($IE->SpinMessageLoop()) { select undef, undef, undef, 0.25; } } $var = Variant( VT_BSTR, "./image.jpg" ); # 4 = SAVE_AS; 3 = HIDE_DIALOG $IE->ExecWB( 4,3,$var,undef );
PS: For some reason I can't see my last post, so here it is again:

Got the following message when trying to run saskaqueer's code:

LWP will support https URLs if the Crypt::SSLeay module is installed. More information at <>.

I tried installing Crypt::SSLeay, but ppm3 does not have a win32 version. As for NetWallah's suggestions, I have a direct URL to the image, so it is not in a frame. It is also under 4 MB, not generated by javascript and not beign re-directed. I can download it manually just fine. I would post the URL, but it would not help since it is part of a password protected site and it would just redirect you to a login.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://416663]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2018-05-23 17:06 GMT
Find Nodes?
    Voting Booth?