How to click on a javascript button with iMacros?

hillz

Registered Member
Joined
Aug 14, 2011
Messages
55
Reaction score
3
Let me explain it with an example, please open this link I want to creat an imacros script for blogspot commenting.
When I record my macro like normal and run it, the "Publish" button sometimes won't click. How do I make it work?
 
Last edited:
Try changing the recording mode in Imacros options and record the click on the "Publish" button, then add that command to your JS script.
 
Do you have the frame added?
Like this:

Code:
FRAME NAME="comment-editor"
TAG POS=1 TYPE=TEXTAREA FORM=ID:commentForm ATTR=ID:commentBodyField CONTENT=Your+Comment+Here*
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:commentForm ATTR=ID:postCommentSubmit

*Change the comment text

Without the frame name its not always clear for iMacros where he need to put the comment, therefore it can fail the macro.
 
Using:
Firefox 43.0.1
IMacros VERSION BUILD=8970419
Windows 7



I'm trying to do the same thing: Create iMacros to post blogspot comments. Tried the above example and can not get it to submit. Ive tried pulling the comment form out and using it "show this frame", Ive tried every example I could find through google search. Has the dynamics changed? Here is what I have tried:
Code:
FRAME NAME="comment-editor"
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>DIV>DIV:nth-of-type(2)>TEXTAREA" KEY=9
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(2)>DIV>SELECT" KEY=9
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(2)>SPAN:nth-of-type(3)>A" KEY=9
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>DIV:nth-of-type(2)>INPUT" KEY=13
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>FORM>DIV:nth-of-type(2)>INPUT" BUTTON=0
'TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:commentForm ATTR=TYPE:button&&VALUE:Publish&&ONCLICK:BLOG_CMT_onPost()&&NAME:postCommentSubmit&&ID:postCommentSubmit&&DISABLED:
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>DIV:nth-of-type(2)>INPUT" KEY=13

ANy thoughts?
 
Back
Top