MacroSyntaxError: wrong format of TAG command, line 16 (Erro

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

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.

MacroSyntaxError: wrong format of TAG command, line 16 (Erro

by o0alvin0o on Fri Jan 12, 2018 7:03 pm

Help me,
Here's the script , error in line 16 : TAG POS=1 TYPE=H1 ATTR=TXT EXTRACT=TXT
Code: Select all
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
SET !VAR2 EVAL("var randomNumber=Math.floor(Math.random()*60 + 1); randomNumber;")
TAB T=1
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>VIDEO" BUTTON=0
WAIT SECONDS={{!VAR1}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>BUTTON" BUTTON=0
WAIT SECONDS={{!VAR1}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>FORM>INPUT:nth-of-type(4)" BUTTON=0
WAIT SECONDS={{!VAR1}}
TAB T=2
URL GOTO=commments.com
WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=H1 ATTR=TXT EXTRACT=TXT
SET !CLIPBOARD {{!EXTRACT}}
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:comment_sent ATTR=ID:comment CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:comment_sent ATTR=*
WAIT SECONDS={{!VAR2}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>A" BUTTON=0

Can someone correct it ?
o0alvin0o
 
Posts: 1
Joined: Fri Jan 12, 2018 6:54 pm

Re: MacroSyntaxError: wrong format of TAG command, line 16 (

by chivracq on Fri Jan 12, 2018 8:25 pm

o0alvin0o wrote:Help me,
Here's the script , error in line 16 : TAG POS=1 TYPE=H1 ATTR=TXT EXTRACT=TXT
Code: Select all
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
SET !VAR2 EVAL("var randomNumber=Math.floor(Math.random()*60 + 1); randomNumber;")
TAB T=1
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>VIDEO" BUTTON=0
WAIT SECONDS={{!VAR1}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(3)>DIV:nth-of-type(3)>BUTTON" BUTTON=0
WAIT SECONDS={{!VAR1}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>FORM>INPUT:nth-of-type(4)" BUTTON=0
WAIT SECONDS={{!VAR1}}
TAB T=2
URL GOTO=commments.com
WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=H1 ATTR=TXT EXTRACT=TXT
SET !CLIPBOARD {{!EXTRACT}}
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:comment_sent ATTR=ID:comment CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:comment_sent ATTR=*
WAIT SECONDS={{!VAR2}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>SECTION>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(2)>DIV>DIV>A" BUTTON=0

Can someone correct it ?

FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for FF v9.0.3, FF v...?, OS...?

And your Thread has nothing specific to iMacros for FF only I would think..., especially if you don't mention your FCI..., try to select the correct Sub-Forum when/next time you open a Thread... (Would have been the 'General' one in this Case..., but no need to duplicate now...)

But..., OK, concerning your Pb..., yep, normal, you specify a 'TXT' Attribute for the 'ATTR' Parameter but you don't specify it any further, or you've hit a bit too frantically on the 'Delete'/'Backspace' Key when you edited the 'TAG' Statement recorded by iMacros to add the 'EXTRACT=TXT' part, ah-ah...!, the Colon after an Attribute is still needed for Syntax-sake...:
Code: Select all
TAG POS=1 TYPE=H1 ATTR=TXT: EXTRACT=TXT
But this one is correct if there is no 'TXT' Content at all for that Element, which would be a bit surprising for an 'H1' Element, what's the point then, ah-ah...!? :shock:

=> I guess you rather need stg like this one:
Code: Select all
TAG POS=1 TYPE=H1 ATTR=TXT:* EXTRACT=TXT

This will extract the first 'H1' Element on your Page...
- (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: 6691
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 8 guests

-->