Extracting an image from a website into a new folder.

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
jc9419
Posts: 5
Joined: Mon May 15, 2017 3:26 pm

Extracting an image from a website into a new folder.

Post by jc9419 » Mon May 15, 2017 3:30 pm

Hello,

As stated in the title, I have looked within the iMacros Wiki and am looking for an option to save a new image from a website and put the image into a new folder each time the script is run. I noticed the SAVETARGETAS function and seem like there is some possibility with this command.

However, is it even possible for this option with just the iMacros language? Or will I have to seek out this possibility with Javascript, C#, etc.

Thanks for any help that may be submit as I have been working for this solution for a few days now. :D
chivracq
Posts: 9577
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting an image from a website into a new folder.

Post by chivracq » Mon May 15, 2017 4:41 pm

jc9419 wrote:Hello,

As stated in the title, I have looked within the iMacros Wiki and am looking for an option to save a new image from a website and put the image into a new folder each time the script is run. I noticed the SAVETARGETAS function and seem like there is some possibility with this command.

However, is it even possible for this option with just the iMacros language? Or will I have to seek out this possibility with Javascript, C#, etc.

Thanks for any help that may be submit as I have been working for this solution for a few days now. :D
CIM...! :mrgreen: (Always mention your FCI when you open a Thread, read my Sig..., many Commands are not implemented for all Browsers/Versions...)

But yep, the 'SAVETARGETAS' Command for the 'CONTENT=EVENT' Parameter for the 'TAG' Command, or 'SAVEITEM' as well, is indeed the Command you need, together with the 'ONDOWNLOAD' Command (placed before the 'TAG' Statement) where the 'FOLDER' Parameter is able to create a new Folder (or even a Tree of Folders).

This is done in pure '.iim', you don't need any JavaScript, C#, etc...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
jc9419
Posts: 5
Joined: Mon May 15, 2017 3:26 pm

Re: Extracting an image from a website into a new folder.

Post by jc9419 » Mon May 15, 2017 7:23 pm

Thank you for the reply Chivracq!

I have the adaptability of using this process within Firefox, Chrome, iMacros 6.9 and iMacros 10.3, whichever would be the most functional for this process.

In accordance with your information, I was wanting to clarify some of the details. Basically, I am in need of going to a google image search and download 6 different images for one task. After I download all of those to one specific folder (say that the folder is: C:\\Documents\Folder1\). Within the example, I would like to add a folder (we'll call this one Folder 2) into Folder 1 that contains those 6 images. After that, I need to run a task in the similar manner, but instead of this set of 6 images going into Folder 2, I would like them to go to another one called Folder 3.

Is this specific process still possible?
chivracq
Posts: 9577
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting an image from a website into a new folder.

Post by chivracq » Mon May 15, 2017 11:37 pm

jc9419 wrote:Thank you for the reply Chivracq!

I have the adaptability of using this process within Firefox, Chrome, iMacros 6.9 and iMacros 10.3, whichever would be the most functional for this process.

In accordance with your information, I was wanting to clarify some of the details. Basically, I am in need of going to a google image search and download 6 different images for one task. After I download all of those to one specific folder (say that the folder is: C:\\Documents\Folder1\). Within the example, I would like to add a folder (we'll call this one Folder 2) into Folder 1 that contains those 6 images. After that, I need to run a task in the similar manner, but instead of this set of 6 images going into Folder 2, I would like them to go to another one called Folder 3.

Is this specific process still possible?
Well, 'SAVETARGETAS' and 'ONDOWNLOAD' are implemented for the 4 Browsers (iMB / IE / FF / CR), so the Choice is yours I would say, simply use your "favorite" Browser, but iMB v6.9 is very old, it was using a different Download Manager that got completely revamped in iMB v10.3.
iMacros for CR requires an additional FIO-Module (FIO = File Input-Output) to be installed for dealing with Local Files like in a Download, and it used to be pretty buggy, but current Version = v8.4.4 for CR finally seems to be a bit stable, but many Commands are still not implemented for CR...

My personal favorite Choice is iMacros for FF, but the latest Version = v9.0.3 is pretty Buggy and limited compared to previous Version = v8.9.7, which is much more stable and still works on FF48/53. And if you later want to add some Conditional Logic to your Macros, iMacros for FF supports Macros written in JavaScript ('.js' Scripts).

Concerning your Folder_1/_2/_3 Structure, yep no Pb, you can use/reuse Variables to (dynamically) define the Names/Paths.

What you want overall is pretty "basic" and is a pretty straightforward Use of iMacros actually, there should hardly be any Difficulties... :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply