1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to click on a javascript button with iMacros?

Discussion in 'Other Scripting Languages' started by hillz, Mar 6, 2014.

  1. hillz

    hillz Registered Member

    Joined:
    Aug 14, 2011
    Messages:
    54
    Likes Received:
    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: Mar 6, 2014
  2. E=MC²

    E=MC² Junior Member

    Joined:
    Apr 12, 2013
    Messages:
    174
    Likes Received:
    182
    Try changing the recording mode in Imacros options and record the click on the "Publish" button, then add that command to your JS script.
     
  3. hillz

    hillz Registered Member

    Joined:
    Aug 14, 2011
    Messages:
    54
    Likes Received:
    3
    I already did that but failed. How do I do URL GOTO=javascript....... with that page to publish my comment? It seems that publish button is linked to a javascript URL but I can't figure out what it is
     
  4. Goodgy

    Goodgy Newbie

    Joined:
    Mar 12, 2014
    Messages:
    1
    Likes Received:
    0
    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.
     
  5. tammy23

    tammy23 Newbie

    Joined:
    Aug 18, 2013
    Messages:
    10
    Likes Received:
    1
    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?