Sign in to follow this  
Followers 0
footswitch

Internet Explorer - AutoSave Pictures avoiding reload

6 posts in this topic

#1 ·  Posted (edited)

Hello world :)

I'm struggling to find a way of saving a regular picture loaded in any page within Internet Explorer.

This is not included/explained in _IE UDF.

I understand there is a way of saving the whole page, but that involves a lot of risk ('Save As' isn't easy to handle, especially when we have different OS languages).

The reason why I need to save the picture directly from the browser (from the loaded page) is because in this case, the picture isn't directly "traceable". It is a randomized picture within a cgi script.

So, if I try to use InetGet or FileCopy with the picture's URL, I eventually end up with a different picture.

Tried to get that from IE's cache folder (Temporary Internet Files), but IE (or the system) "hides" the real contents of the folder! It only allows access to something like a folder named 'AntiPhishing'. Clever...

Thanks a lot in advance for your thoughts on this.

EDIT: title changed

Regards,

footswitch

Edited by footswitch

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe this can help:

From the help file:

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/")
$oImgs = _IEImgGetCollection ($oIE)
$iNumImg = @extended
MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")
For $oImg In $oImgs
    MsgBox(0, "Img Info", "src=" & $oImg.src)
Next

Now that you have the URL's, I suppose you could use InetGet to download them and save them to your HD.

Edited by Nahuel

Share this post


Link to post
Share on other sites

Maybe this can help:

From the help file:

#include <IE.au3>
$oIE = _IECreate ("http://www.autoitscript.com/")
$oImgs = _IEImgGetCollection ($oIE)
$iNumImg = @extended
MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")
For $oImg In $oImgs
    MsgBox(0, "Img Info", "src=" & $oImg.src)
Next

Now that you have the URL's, I suppose you could use InetGet to download them and save them to your HD.

I think he is saying that another trip to the server will generate a new picture. Check out the new parameters to _IEPropertyGet that allow you to get the browser or screen coordinates of an object. Once you have that you can automate a right-click and save image as... to get a copy. If you're wanting to analyze the graphic you may also be able to do that in place once you know the coordinates without downloading it.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Oh you mean like a captcha image?

Yeah sorry, I read your post too fast. I tend to do that.

Share this post


Link to post
Share on other sites

Thank you for your replies.

I'm still looking for the best way to do this, since I'm handling several OS languages, thus several IE languages.

Copying the image to the clipboard could be a solution.

But how? I found this as a way of copying text within an IE document:

http://www.htmlgoodies.com/beyond/javascri...cle.php/3458851

and I'm trying to discover a way of copying images to the clipboard (hopefully without using right-click menu).

Another thing that goes in my mind is somehow change the body via autoit after the page is loaded and preserve the image or change some of its attributes. Is this possible?

And I'm still trying to figure out how to obtain content from IE's cache folder.


Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If anyone comes across this post, be informed that I did a workaround for my particular situation, and this could not be used as a general all purpose code.

However, I found some stuff recently that maybe could lead to an acceptable solution:

Solution no. 1: Dale's suggestion above.

Solution no. 2:

- Do as Dale suggests: "Check out the new parameters to _IEPropertyGet that allow you to get the browser or screen coordinates of an object"; if it is possible to show the object on the screen, you could then perform a Screen Capture:

- Implement your own screen capturer with Auto3Lib (by PaulIA)

- Windows Screener (by Generator) (also requires Auto3Lib)

Solution no. 3:

- Implement a search function that supports hidden and system folders and that can search directories recursively - the Temporary Internet Files folder and its subfolders;

- Search for the filename and retrieve it from there.

Good luck! :)

Edited by footswitch

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0