why isn't relative positioning working?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
User avatar
322126384
Posts: 32
Joined: Sat Jul 23, 2011 1:39 am

why isn't relative positioning working?

Post by 322126384 » Wed Aug 17, 2011 7:51 pm

i'm running this macro that finds the level between 50-99 and then the macro clicks on a button to submit. it should work only if the previous TAG command is successful by using the relative positioning.
but for some reason the submit button is not being clicked. i think it might be because the submit button is in the <p> html tag and the button is in the same <p> tag.

Here is the html:

<p>
Level: 12
<input type="hidden" value="Battle" name="wildpoke" id="finding">
<input type="submit" value="Battle!" name="49579" id="49579">
</p>

and here is the code:

Code: Select all

SET !ERRORIGNORE YES
SEARCH SOURCE=REGEXP:"Level: ([5-9][0-9])" EXTRACT=$1
TAG POS=1 TYPE=P ATTR=TXT:Level:<SP>{{!EXTRACT}}
TAG POS=R1 TYPE=INPUT:SUBMIT FORM=NAME:* ATTR=ID:*
-322126384
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: why isn't relative positioning working?

Post by MattBell7 » Thu Aug 18, 2011 11:12 am

Relative positioning starts from the end of the current element, and won't match anything inside it.

again i've already raised this with iopus as there is no way to dynamically select an element inside the currently selected item.

What you'll need to do, is select an element either before or after the <p> tag, then use relative to drop back in. it should work.

e.g.

Code: Select all

SET !ERRORIGNORE YES
SEARCH SOURCE=REGEXP:"Level: ([5-9][0-9])" EXTRACT=$1
TAG POS=1 TYPE=P ATTR=TXT:Level:<SP>{{!EXTRACT}}
TAG POS=R1 TYPE=P ATTR=TXT:*
TAG POS=R-1 TYPE=INPUT:SUBMIT FORM=NAME:* ATTR=ID:*
Post Reply