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.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Extracting an image from a website into a new folder.

by jc9419 on Mon May 15, 2017 8:30 am

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

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

by chivracq on Mon May 15, 2017 9:41 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

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

by jc9419 on Mon May 15, 2017 12: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?
jc9419
 
Posts: 5
Joined: Mon May 15, 2017 8:26 am

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

by chivracq on Mon May 15, 2017 4: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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 5 guests

-->