How to make it click on TXT if there is an image

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
ngEAr
Posts: 6
Joined: Fri Oct 29, 2010 12:16 pm

How to make it click on TXT if there is an image

Post by ngEAr » Tue Dec 14, 2010 4:36 pm

Here is the code of the line which i wanted to get clicked.

Code: Select all

<img height="12" alt="" width="12" src="http://static.barbars.ru/images/icons/redarrow-s.png" border="0"/> <a class="" href="?wicket:interface=:3:nearLocation:2:locationLink::ILinkListener::&action=1292344429041"><span>Нижний перевал</span></a>
</div>
If using HTM , then it gets TXT and clicks. The problem here is that there is an image near the txt.
image<sp>TXT. So i want it to click only when that image is there , since the image changes based on what's happenning in the process.

Basically its like this:

http://static.barbars.ru/images/icons/redarrow-s.png , if there is this image then i want it to click on TXT if not ignore to timeout.
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

Re: How to make it click on TXT if there is an image

Post by siniy » Thu Dec 16, 2010 5:02 pm

нихуя не понял
Tom, Tech Support
Posts: 3635
Joined: Mon May 31, 2010 4:59 pm

Re: How to make it click on TXT if there is an image

Post by Tom, Tech Support » Fri Dec 17, 2010 4:51 pm

Hi ngEAr,

You can do this with the built-in Javascript scripting interface:

Code: Select all

var ret, macro1, macro2;

macro1 = "CODE:TAG POS=1 TYPE=IMG ATTR=SRC:http://static.barbars.ru/images/icons/redarrow-s.png\n";

macro2 = macro1 + "TAG POS=R1 TYPE=A ATTR=TXT:*\n";

ret = iimPlay(macro1);

if (ret == 1) {
    iimPlay(macro2);
}
Regards,

Tom, iMacros Support
Post Reply