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.

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.

Extract and save VAR

by zurello on Tue Sep 12, 2017 5:26 am

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
zurello
 
Posts: 13
Joined: Mon Jul 18, 2016 11:08 pm

Re: Extract and save VAR

by chivracq on Tue Sep 12, 2017 7:21 am

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)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: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extract and save VAR

by zurello on Tue Sep 12, 2017 11:43 pm

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
zurello
 
Posts: 13
Joined: Mon Jul 18, 2016 11:08 pm

Re: Extract and save VAR

by chivracq on Wed Sep 13, 2017 1: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)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: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extract and save VAR

by zurello on Wed Sep 13, 2017 1: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
zurello
 
Posts: 13
Joined: Mon Jul 18, 2016 11:08 pm

Re: Extract and save VAR

by chivracq on Wed Sep 13, 2017 3: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)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: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extract and save VAR

by zurello on Wed Sep 13, 2017 4: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:
zurello
 
Posts: 13
Joined: Mon Jul 18, 2016 11:08 pm

Re: Extract and save VAR

by chivracq on Wed Sep 13, 2017 6:05 am

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)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: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Google [Bot] and 7 guests

-->