Extract and save VAR

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
zurello
Posts: 16
Joined: Tue Jul 19, 2016 6:08 am

Extract and save VAR

Post by zurello » Tue Sep 12, 2017 12:26 pm

Hi, i'm here again to find some help.
I have a macro that generate random mail to fill a form.
I need domething to save in a text file the random mail generated.
I try some days to do by myself,but nothing to do.
I try with EXTRACT, SAVEAS,TAG...nothing :( .
Here is my macro

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES

I think that the additional code must be placed here, but it is over my possibility :( .
I have Windows 7, Firefox 55.0.3 (64 bit), Imacros 8.9.7.
Bye and thank you for attention
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract and save VAR

Post by chivracq » Tue Sep 12, 2017 2:21 pm

zurello wrote:

Code: Select all

Windows 7, Firefox 55.0.3 (64 bit), Imacros 8.9.7.
Hi, i'm here again to find some help.
I have a macro that generate random mail to fill a form.
I need domething to save in a text file the random mail generated.
I try some days to do by myself,but nothing to do.
I try with EXTRACT, SAVEAS,TAG...nothing :( .
Here is my macro

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES

I think that the additional code must be placed here, but it is over my possibility :( .
I have Windows 7, Firefox 55.0.3 (64 bit), Imacros 8.9.7.
Bye and thank you for attention
Hum..., I don't like to help for such Scripts that are usually used/misused to generate Spam, but OK, you already have most of the "Functionality" already implemented... :roll:

Euh..., yep, trying to (re)extract from an 'INPUT' Field can sometimes be a bit tricky...
But in your Case, you already have your '!VAR1' (+ Email Address), simply use '!EXTRACT' + 'SAVEAS'... :idea:

(And who designed that Site cannot spell "participation" correctly, ah-ah...! :wink: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
zurello
Posts: 16
Joined: Tue Jul 19, 2016 6:08 am

Re: Extract and save VAR

Post by zurello » Wed Sep 13, 2017 6:43 am

Hi, and thanx for help :D .
I do it, you turn my lamp on :idea: !
I make this, and it works fine :)

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email EXTRACT=TXT
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/create ATTR=ID:submit
SAVEAS TYPE=EXTRACT FOLDER=D: FILE=mail.txt

 
I assure you that i don't use my macro for spamming!
Thank you for help and..."participation".
Bye
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract and save VAR

Post by chivracq » Wed Sep 13, 2017 8:18 am

zurello wrote:Hi, and thanx for help :D .
I do it, you turn my lamp on :idea: !
I make this, and it works fine :)

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email EXTRACT=TXT
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/create ATTR=ID:submit
SAVEAS TYPE=EXTRACT FOLDER=D: FILE=mail.txt 
I assure you that i don't use my macro for spamming!
Thank you for help and..."participation".
Bye
Ah OK, you still prefer to re-extract the E-mail Address from the 'INPUT' Field, I thought you had already tried that and that it was not working...

More "straightforward" would be to handle yourself directly the Content of the '!EXTRACT' Var like I suggested in my previous Reply..., but OK, if it works now, I guess you are already happy... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
zurello
Posts: 16
Joined: Tue Jul 19, 2016 6:08 am

Re: Extract and save VAR

Post by zurello » Wed Sep 13, 2017 8:23 am

Yeah, it works and now i'm happy 8) .
Now i'm trying to insert a number before the mail extracted to identify how many mail macro creates.
keep finger crossed :wink: !

Mission accomplished!

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
ADD !EXTRACT {{!LOOP}}
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email EXTRACT=TXT
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/create ATTR=ID:submit
SAVEAS TYPE=EXTRACT FOLDER=D: FILE=mail.txt
:D :D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract and save VAR

Post by chivracq » Wed Sep 13, 2017 10:31 am

zurello wrote:Yeah, it works and now i'm happy 8) .
Now i'm trying to insert a number before the mail extracted to identify how many mail macro creates.
keep finger crossed :wink: !

Mission accomplished!

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
ADD !EXTRACT {{!LOOP}}
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 12; i++){string += letters[parseInt(Math.random() * 25)]}; string")
TAG POS=4 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=* CONTENT=20/03/1974
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:name CONTENT=pinco
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:surname CONTENT=dominici
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_birth_place CONTENT=Rome
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_mobile_phone CONTENT=123456
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email CONTENT={{!var1}}@libero.it
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/create ATTR=ID:partecipation_email EXTRACT=TXT
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:/create ATTR=ID:partecipation_accept_recall CONTENT=YES
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/create ATTR=ID:submit
SAVEAS TYPE=EXTRACT FOLDER=D: FILE=mail.txt
:D :D
Yep..., exactly what I meant...! And you could have used the same 'SET/ADD !EXTRACT' Mechanism for the E-mail Address as well:

Code: Select all

SET !VAR1 EVAL("...etc...")
SET !EXTRACT {{!LOOP}}
ADD !EXTRACT {{!VAR1}}@libero.it
SAVEAS TYPE=EXTRACT FOLDER=D: FILE=mail.txt
Like that, you don't need to re-extract your E-mail Address from the Page...

The only "valid" Reason I can see for re-extracting the E-mail Address would be to do the 'EXTRACT' after the 'Submit' in case "stg goes wrong" with the Validation from the Site if you wanted to check that that new Profile got "accepted" by the Site...
Some Sites do not allow certain Keywords for E-mail Addresses, and your Random Generator could have included "...shit..." or "...sex..." or any forbidden Word in the Random String...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
zurello
Posts: 16
Joined: Tue Jul 19, 2016 6:08 am

Re: Extract and save VAR

Post by zurello » Wed Sep 13, 2017 11:45 am

I re-extract the E-mail addres because i haven't think about 'SET/ADD !EXTRACT' Mechanism :roll: .
Thank you for your help and for everything you teached me :wink:
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract and save VAR

Post by chivracq » Wed Sep 13, 2017 1:05 pm

zurello wrote:I re-extract the E-mail addres because i haven't think about 'SET/ADD !EXTRACT' Mechanism :roll: .
Thank you for your help and for everything you teached me :wink:
"... because i haven't think/[thought] about 'SET/ADD !EXTRACT' Mechanism..."
=> Euh...!?, that was exactly my first and only Suggestion in my first Reply in this current Thread, ah-ah...!:
But in your Case, you already have your '!VAR1' (+ Email Address), simply use '!EXTRACT' + 'SAVEAS'... :idea:
But OK, don't worry..., I guess now you understand a bit better the 'EXTRACT' + '!EXTRACT' + 'SAVEAS' Mechanism... :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply