Trying to automate gmail account creation using iMacros. Facing problem in selecting Gender and Month.
Tried StackOverFlowSolution but it is not working for me. It reports that the command not found. Is it some version mismatch issue or am I missing something?
Can anybody help me in resolving this?
Pasted below the recording along with this fix for reference.
VERSION BUILD=8340723 RECORDER=CR
URL GOTO=https://accounts.google.com/SignUp?dsh=447577167596141020&continue=https%3A%2F%2Faccounts.google.com%2FManageAccount#FirstName=&LastName=
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:createaccount ATTR=ID:PasswdAgain CONTENT=asdf123
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:createaccount ATTR=ID:BirthDay CONTENT=15
TAG POS=1 TYPE=SPAN ATTR=ID:birthyear-placeholder
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:createaccount ATTR=ID:BirthYear CONTENT=1989
TAG POS=1 TYPE=INPUT:TEL FORM=ID:createaccount ATTR=ID:RecoveryPhoneNumber CONTENT=+919791151088
SET monthNum 7
SET monthSlc EVAL("var s = '{{monthNum}}'; switch ('{{monthNum}}') {case '10': s = 'a'; break; case '11': s = 'b'; break; case '12': s = 'c'; break;} '#\\\\:' + s + '>DIV';")
SET listSlc "#BirthMonth>DIV>DIV:nth-of-type(2)"
EVENT TYPE=MOUSEDOWN SELECTOR={{listSlc}} BUTTON=0
EVENT TYPE=MOUSEUP SELECTOR={{listSlc}} BUTTON=0
EVENT TYPE=MOUSEDOWN SELECTOR={{monthSlc}} BUTTON=0
EVENT TYPE=MOUSEUP SELECTOR={{monthSlc}} BUTTON=0
You could definitely do this with imacros. Just a small workaround for this.
Below is the code
TAG POS=1 TYPE=INPUT:HIDDEN ATTR=ID:HiddenBirthMonth CONTENT=05
TAG POS=1 TYPE=INPUT:HIDDEN ATTR=ID:HiddenGender CONTENT=MALE
You can change the above Hidden Input Field's value, and the Month and Gender will get updated (though it might not be visible for the user)
Cheers!
I just checked and actually they seem use div and not a select to do it.
The change is probably triggered by javascript. But I thing it would be a waste to time trying to go through their's.
I just saw that the month change the attribute aria-posinset="6". Here it is for June. I don't think that you can change one with iMacros.
For the current form, dated 11/1/2018. I did the following and it worked to populate gender and month:
TAG POS=1 TYPE=SELECT ATTR=ID:gender CONTENT=3
TAG POS=1 TYPE=SELECT ATTR=ID:month CONTENT=3
The #3 for CONTENT is just the option number to select. You can change that accordingly.
Related
IMACROS: VERSION BUILD=1010 RECORDER=CR Free version
Windows 10 English
Chrome: Version 90.0.4430.85 (Official Build) (64-bit)
I have close to 7500 'users' in my database. I need to change one, then go to next, etc. I am thinking I need to take the user ID -in the example below that is "7378", and subtract 1 for the next command. I am sure this is easy but I cannot figure it out. Here is what I have that needs to repeat, minus 1, each time:
TAG POS=1 TYPE=TD ATTR=TXT:7378
TAG POS=7 TYPE=BUTTON ATTR=TXT:Edit
TAG POS=1 TYPE=BUTTON FORM=ACTION:https://xxx.xxx.com/admin/users/7378/edit ATTR=TXT:Change
TAG POS=2 TYPE=INPUT:RADIO ATTR=*
TAG POS=1 TYPE=BUTTON ATTR=TXT:OK
TAG POS=1 TYPE=BUTTON ATTR=TXT:Save
Thank you in advance!
Solution for the following FCI:
IMACROS: VERSION BUILD=1010 RECORDER=CR 'Free'
Windows 10 English
Chrome: Version 90.0.4430.85 (Official Build) (64-bit)
(Will work for all 'Free' Versions, using '!VAR[1-3]', as User Defined Vars are not supported in the 'Free' Versions.)
'Set some Start User_ID: (Needs to be +1 from the "real" Start ID.)
SET !VAR1 7379
ADD !VAR1 -{{!LOOP}}
'TAG POS=1 TYPE=TD ATTR=TXT:7378 // (Recorded)
TAG POS=1 TYPE=TD ATTR=TXT:{{!VAR1}}
'>
TAG POS=7 TYPE=BUTTON ATTR=TXT:Edit
'>
'TAG POS=1 TYPE=BUTTON FORM=ACTION:https://xxx.xxx.com/admin/users/7378/edit ATTR=TXT:Change // (Recorded)
TAG POS=1 TYPE=BUTTON FORM=ACTION:https://*/admin/users/{{!VAR1}}/edit ATTR=TXT:Change
'>
TAG POS=2 TYPE=INPUT:RADIO ATTR=*
TAG POS=1 TYPE=BUTTON ATTR=TXT:OK
TAG POS=1 TYPE=BUTTON ATTR=TXT:Save
... And you can loop that Script 100 times (Max Loop Value for the 'Free' Versions).
... And you'll need to manually edit the SET !VAR1 7379 to SET !VAR1 7279 then to 7179 etc before running the next 100 Loops...
Glossary:
FCI = Full Config Info (=> iMacros + Browser + OS + 'Free'/'PE'/'Trial'/'Pro'/'Enterprise' + all exact Versions.)
PE = Personal Edition.
OP = Original Post. // #OP/#OP = Original Poster.
Qt = Question.
i have a piece of imacros code for sending out Yahoo eMails which works great. But except for pasting content in the body field. I have tried a few other methods using imacros, but i can't get this part to work.
Here is my code. Appreciate any help. :)
VERSION BUILD=844 RECORDER=CR
SET EMAIL "test#test.com"
SET PASS "password"
SET !ERRORIGNORE YES
URL GOTO=https://login.yahoo.com/?.src=ym&.intl=us&.lang=en-US&.done=https%3a//mail.yahoo.com
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:mbr-login-form ATTR=ID:login-username CONTENT={{EMAIL}}
TAG POS=1 TYPE=BUTTON FORM=ID:mbr-login-form ATTR=ID:login-signin
SET !ENCRYPTION NO
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:mbr-login-form ATTR=ID:login-passwd CONTENT={{PASS}}
TAG POS=1 TYPE=BUTTON FORM=ID:mbr-login-form ATTR=ID:login-signin
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=ID:yui_3_16_0_ym19_1_*
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:to-field CONTENT=test#gmail.com
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:subject-field CONTENT=test
TAG POS=1 TYPE=DIV ATTR=ID:rtetext
TAG POS=5 TYPE=SPAN ATTR=ID:yui_3_16_0_ym19_1_*
Have you tried using the Event recording mode (iMacros Sidebar - Manage Tab - Settings) for entering the message body? I tried a quick recording myself and found that the following two commands together were successful in filling the message body:
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(9)>DIV:nth-of-type(3)>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(7)>DIV>TABLE>TBODY>TR:nth-of-type(2)>TD>DIV>DIV>DIV:nth-of-type(2)" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(9)>DIV:nth-of-type(3)>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(7)>DIV>TABLE>TBODY>TR:nth-of-type(2)>TD>DIV>DIV>DIV:nth-of-type(2)" CHARS="this is a test"
I cannot find a way to click on the button on Google Drive to click "File upload"
in Inspect element cannot find the exactly class which is changing every time,
trued to record with all kind of style but still not working.
Would be great if some one can check and figure out how it can be clicked.
Thank You in advance.
URL GOTO=https://drive.google.com/drive/my-drive
EVENT TYPE=MOUSEDOWN SELECTOR="#drive_main_page>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0
TAG POS=2 TYPE=DIV ATTR=CLASS:*-v&&ROLE:menuitem&&ID::4b
TAG POS=1 TYPE=INPUT:FILE ATTR=* CONTENT=C:\Users\Viktor\Documents\iMacros\Downloads\Folder\1.png
The following solution seems to work somehow:
' text for English as default language '
SET txtUpload "Upload files..."
URL GOTO=https://drive.google.com/drive/my-drive
EVENT TYPE=CLICK SELECTOR="#drive_main_page>DIV:nth-of-type(4)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>svg>polygon" BUTTON=0
WAIT SECONDS=0.5
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=DIV ATTR=TXT:{{txtUpload}} EXTRACT=HTM
SET id EVAL("'{{!EXTRACT}}'.match(/id=\"(.+?)\"/)[1];")
EVENT TYPE=CLICK SELECTOR="#\\{{id}}>DIV>SPAN:nth-of-type(2)>SPAN>DIV" BUTTON=0
TAG POS=1 TYPE=INPUT:FILE ATTR=* CONTENT=C:\Users\Viktor\Documents\iMacros\Downloads\Folder\1.png
I am really new to iMacros but seem to have a basic understanding of how it works. However, I have two problems that I just can't seem to resolve. The iMacros loads from and executable service that is ran whenever needed to get information. Once the data is extracted the service takes it and writes it to a file on the servers C drive. This has been working fine up till about a month ago. Amazon changed the website and now I can't get the script to cooperate. All help resolving this would be greatly appreciated.
The script does not extract the text, and
A new iMacros browser opens after each run-through of the script.
I have researched the internet, manipulated the script many different ways, and I have used the record option, as well as the wizard to create the script to extract the data. I'm not sure what I am missing. My script is below.
VERSION BUILD=7401598
TAB T=1
URL GOTO=https://sellercentral.amazon.com/gp/fba/revenue-calculator/index.html/ref=au_xx_cont_xx?ie=UTF8&lang=en_US
WAIT SECONDS=10
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:search-form ATTR=ID:search-string CONTENT={{Asin}}
WAIT SECONDS=10
TAG POS=1 TYPE=BUTTON ATTR=ID:search-products
WAIT SECONDS=10
TAG POS=1 TYPE=BUTTON ATTR=ID:update-fees-link
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Order<SP>Handling
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Pick<SP>&<SP>Pack
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Weight<SP>Handling
WAIT SECONDS=10
The text I need to extract is Order handling, Pick & Pack, Weight Handling.
You should try placing EXTRACT=TXT after the commands. Also check the html of page and make a command if record doesn't work. If for example you have a link on a page this would be it's HTML code.
click me
iMacros to extract link and text from this are.
TAG POS=1 TYPE=A ATTR=HREF:www.somestuff.com EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=HREF:www.somestuff.com EXTRACT=HREF
There are few other variations but this is the main part. In your case this would be the proper code.
TAG POS=1 TYPE=BUTTON ATTR=ID:search-products EXTRACT = TXT
WAIT SECONDS=10
TAG POS=1 TYPE=BUTTON ATTR=ID:update-fees-link EXTRACT = TXT
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Order<SP>Handling EXTRACT = TXT
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Pick<SP>&<SP>Pack EXTRACT = TXT
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=TXT:Weight<SP>Handling EXTRACT = TXT
WAIT SECONDS=10
Try it and please use iMacros FireFox addon for this.
Edit:
You can declare one scraping macro in JavaScript.
var macroScrape;
macroScrape ="CODE:";
macroScrape +="TAG POS=1 TYPE=BUTTON ATTR=ID:search-products EXTRACT = TXT";
iimPlay(macroScrape)
var text=iimGetLastExtract();
alert(text);
I use only once EXTRACT command in once macro. If I need more info scraped I use more macro codes declared as a variable in the example above. This could work if you know how to use it.
iMacros support is sometimes really slow.
I'm trying to make iMacros send me an email, if after login I get a dialog. In this
case its a warning that I should update my password before it expires.
I would like some output to php that I can use to send the email. I'm presently able to get getLastExtract but nothing in the returned array mentions the dialog in any way.
This is the script so far:
CODE: SET !REPLAYSPEED FAST
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=[URL]
SET !EXTRACTDIALOG YES
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:adminLogin ATTR=ID:username CONTENT=[username]
SET !ENCRYPTION NO
ONDIALOG POS=1 BUTTON=NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:adminLogin ATTR=ID:password CONTENT=[password]
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:adminLogin ATTR=VALUE:Login