How to "NEXT" step if found some text ?

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
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

How to "NEXT" step if found some text ?

Post by Mr.NamMo » Thu Oct 09, 2014 3:42 am

How to "NEXT" if found some text ?

I use iMacros v8.8.2 in my Firefox v32.0.3 WIN7 64Bit
How to NEXT imacros steps if found some text

VERSION BUILD=8332211 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT_TAG 1
SET !TIMEOUT_STEP 1
SET !TIMEOUT_PAGE 30
SET !REPLAYSPEED FAST
TAB T=1

URL GOTO=http://www.tiepnoi.com/traodoi_facebook.php

'Page show text : "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác."
'& Page i get info such as : <div class="error">Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác.</div>
I want use such as :

If text = "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác." then go to URL GOTO=http://www.tiepnoi.com/abcdef.php & make code.
If text NOT "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác." continues code

TAG POS=1 TYPE=A ATTR=TXT:Like
TAB T=2
FRAME F=0
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:"Like"
TAG POS=1 TYPE=BUTTON ATTR=VALUE:"1"
TAB T=2
WAIT SECONDS=2
TAB T=1
TAB CLOSEALLOTHERS
WAIT SECONDS=5
that my script and in red text i need to do that but i do not ,, please help!
Regards! :D

This is code of me:
FILE : A.IIM

VERSION BUILD=8332211 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT_TAG 1
SET !TIMEOUT_STEP 1
SET !TIMEOUT_PAGE 30
SET !REPLAYSPEED FAST
TAB T=1
URL GOTO=http://www.tiepnoi.com/traodoi_facebook.php
WAIT SECONDS=0
TAG POS=1 TYPE=A ATTR=TXT:Like
TAB T=2
FRAME F=0
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:"Like"
TAG POS=1 TYPE=BUTTON ATTR=VALUE:"1"
TAB T=2
WAIT SECONDS=2
TAB T=1
TAB CLOSEALLOTHERS
WAIT SECONDS=5


OR MOD CAN HELP ME BUILT *.JS CHECK RUN TEXT "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác."
Play code a.iim if page show text "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác." run code b.iim
if b.iim have text "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác." run code c.iim
& etc .... & run back code a.iiim.

LOOP to 9999 stop.


I'm newcomer using imacros & have FAQ seachimage but i cant make run code true with me because code of me basic.
Plzz help me.
Many thanks to every thanks support.
Have a nice day.
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Thu Oct 09, 2014 5:42 pm

Up for help.
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: How to "NEXT" step if found some text ?

Post by skippyto » Fri Oct 10, 2014 6:33 am

Hi Mr.NamMo

Maybe what you are loking for is "CONTENT=EVENT:FAIL_IF_FOUND" (http://wiki.imacros.net/Checkpoints)

Hope this help !

Skippyto.
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Fri Oct 10, 2014 8:27 am

skippyto wrote:Hi Mr.NamMo
Maybe what you are loking for is "CONTENT=EVENT:FAIL_IF_FOUND" (http://wiki.imacros.net/Checkpoints)
Hope this help !
Skippyto.
Thanks so much.
I'll test with it.
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Thu Nov 13, 2014 3:55 am

Plzz help me code run it.
I can't find away run good.
With page info:
<div class="msg">
<div class="error">Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác.</div>
</div>

I code 2 option but i dont know why it cant work :(

Code: Select all

var HLink = "CODE:"+"URL GOTO=http://www.tiepnoi.com/traodoi_google.php"+ "\n";
HLink+="VERSION BUILD=2014401 RECORDER=FX" + "\n";
HLink+="TAB T=1" + "\n";
//HLink+="TAG POS=1 TYPE=div ATTR=class:error EXTRACT=HREF" + "\n";

do
{
iimPlay(HLink);
    var a = iimGetExtract(HLink);
    //var b = "Hiện không còn trang khác để tăng xu. Bạn hãy chọn mục khác"
var list=document.getElementsByClassName("msg");

		var b = list.getElementsByTagName("div").getAttribute("class");
		if(b=="error")
			{
				iimPlay("C:\\Youtube.iim");
			}
		else
			{
				iimPlay("C:\\Facebook.iim");
			}
	}
	
while (1==1);

Code: Select all

var HLink;
HLink+="VERSION BUILD=2014401 RECORDER=FX" + "\n";
HLink+="TAB T=1" + "\n";
HLink= "CODE:"+"URL GOTO=http://www.tiepnoi.com/traodoi_google.php"+ "\n";
HLink+="TAG POS=1 TYPE=div ATTR=class:error EXTRACT=TXT" + "\n";


iimPlay(HLink);
var result=iimGetLastExtract();
    if(result == "Hiện không còn trang khác để tăng xu")
    {
        iimPlay("C:\\Youtube.iim");
    }
    else
    {
        iimPlay("C:\\Facebook.iim");
    }
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Fri Nov 14, 2014 2:22 am

Up for help.
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Thu Nov 27, 2014 4:44 pm

Up for help :(
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: How to "NEXT" step if found some text ?

Post by additional001 » Fri Nov 28, 2014 3:09 am

Your HLink variable is not being constructed correctly. Also you had some things that might have been capitalization errors in the last TAG line. This would be my correction.


Code: Select all

var nL="\n"

HLink ="CODE:"
HLink = HLink+"URL GOTO=http://www.tiepnoi.com/traodoi_google.php"+ "nL;
HLink = HLink+"VERSION BUILD=2014401 RECORDER=FX" + nL;
HLink= HLink+"TAB T=1" + nL;
//HLink = HLink+"TAG POS=1 TYPE=DIV ATTR=CLASS:error EXTRACT=HREF";

iimPlay(HLink)
Mr.NamMo
Posts: 22
Joined: Tue Oct 07, 2014 1:24 am

Re: How to "NEXT" step if found some text ?

Post by Mr.NamMo » Sat Dec 06, 2014 12:06 pm

additional001 wrote:Your HLink variable is not being constructed correctly. Also you had some things that might have been capitalization errors in the last TAG line. This would be my correction.

Code: Select all

var nL="\n"
HLink ="CODE:"
HLink = HLink+"URL GOTO=http://www.tiepnoi.com/traodoi_google.php"+ "nL;
HLink = HLink+"VERSION BUILD=2014401 RECORDER=FX" + nL;
HLink= HLink+"TAB T=1" + nL;
//HLink = HLink+"TAG POS=1 TYPE=DIV ATTR=CLASS:error EXTRACT=HREF";
iimPlay(HLink)
Help me away run good.
Plzz. A Long time :(
Post Reply