Saving an image with a ? in it?

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
infernusdoleo
Posts: 9
Joined: Mon Jan 11, 2010 5:50 pm

Saving an image with a ? in it?

Post by infernusdoleo » Tue Jan 12, 2010 1:27 am

I'm trying to save an image that has a ? in the URL and no /jpg extension... the Save Item function doesnt recgonzie it... it says Item Not Found #23... (The IMG tag is:

<IMG style="BORDER-BOTTOM: blue 2px solid; BORDER-LEFT: blue 2px solid; DISPLAY: block; BORDER-TOP: blue 2px solid; BORDER-RIGHT: blue 2px solid" id=Image title="Imagedelta" alt=imagehere" src="https://blahblah.com/imageprocessor?id= ... 3257941942" width=200 height=48>

)

If I add the tag anyway it tries to find on alt=imagehere and then fails when it runs...

Problem is if I extract out the URL and save as - its a new image... the image is generated each time it loads, so I MUST save from the browser cache...

But Item Not Found #23...

Any way around this?
Hannes, Tech Support

Re: Saving an image with a ? in it?

Post by Hannes, Tech Support » Tue Jan 12, 2010 11:34 am

The quotation mark may irritate the macro.
How about

Code: Select all

TAG POS=1 TYPE=IMG ATTR=ALT:imagehere*  CONTENT=EVENT:SAVEITEM 
infernusdoleo
Posts: 9
Joined: Mon Jan 11, 2010 5:50 pm

Re: Saving an image with a ? in it?

Post by infernusdoleo » Tue Jan 12, 2010 2:22 pm

I've tried a few different ways... ATTR=ID: and ATTR=HREF: and I keep getting an error:

SaveItem Timeout: Could not download item from <url here I'm not typing it all out ;)> (Error code: -335)

If it saves it from the cache, how is it not able to 'download' it?
Hannes, Tech Support

Re: Saving an image with a ? in it?

Post by Hannes, Tech Support » Tue Jan 12, 2010 3:58 pm

Can you give us the real HTML code, or some URL that we can use to recreate this issue?

Using your code sample I get that error, because src does not point to a real image's URL.
infernusdoleo
Posts: 9
Joined: Mon Jan 11, 2010 5:50 pm

Re: Saving an image with a ? in it?

Post by infernusdoleo » Wed Jan 13, 2010 3:21 pm

I'm letting this one slide, its likely an issue on that site only... I made a workaround and it works... if I get time later I'll get you the code so you can check it out, but for now its a project thats gone by the wayside for me... thanks.
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: Saving an image with a ? in it?

Post by tata668 » Sat Feb 13, 2010 4:14 pm

Using: Firefox 3.6 - imacros 6.88

There really IS a problem with iMacros not taking the image from the cache, even if it's there.

Using Live HTTP headers I see the image is requested by the "SAVEITEM" (or SAVEPICTUREAS) even if the image IS in the cache (about:cache or CacheViewer). I even use BetterCache to be sure the images are cached.

I will send you an email with an example of site containing an image impossible to save using iMacros.
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: Saving an image with a ? in it?

Post by tata668 » Sat Feb 13, 2010 4:26 pm

Your support contact form doesn't work well when submitted.

Code: Select all

Not Found

The requested URL /service/support/thankyou.asp was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Not sure if my message was actually sent..
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: Saving an image with a ? in it?

Post by tata668 » Sat Feb 13, 2010 4:38 pm

I actually found a very, very, quirky workaround for this issue.

Enabling "Work offline" in firefox before saving the image does the trick: the image is taken from the cache instead of getting requested again (well at least when using BetterCache to be sure the image is actually cached).

I use the scripting edition of iMacros with firefox (-fx). I sometimes use AutoHotkey in my automation process. Using AutoHotkey to send the keys "alt-f-w" to firefox puts it in offline mode. I'll do that before saving my image. And once the image is saved I'll switch back to online mode, again using AutoHotkey.

This is a really ugly workaround but it's the only thing working! :|
Hannes, Tech Support

Re: Saving an image with a ? in it?

Post by Hannes, Tech Support » Mon Feb 15, 2010 8:51 am

Thanks for sharing your workaround. I have pointed the developers to this issue.

Is there a minimal working macro that they can use to recreate the issue easily?
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: Saving an image with a ? in it?

Post by tata668 » Mon Feb 15, 2010 5:07 pm

Hannes, iOpus wrote:Thanks for sharing your workaround. I have pointed the developers to this issue.

Is there a minimal working macro that they can use to recreate the issue easily?
On a web page where the problem exists, this code would be enough to see the image is requested again:

Code: Select all

ONDOWNLOAD FOLDER=C:\ FILE=pic.gif WAIT=YES
TAG POS=1 TYPE=IMG ATTR=HREF:*/image.php* CONTENT=EVENT:SAVEITEM 
You'll have to use "Live HTTP headers" or another web traffic viewer tool, to see the image is not getted from the cache, but requested again from the web site.

I don't want to write any example url here, but if there is an email I can send it to, I will...
Post Reply