Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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 <http://www.linpro.no/lwp/libwww-perl/README.SSL>.

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.


Comment on Re^4: save image on web
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://416663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-10-20 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (92 votes), past polls