
How do I wait until a string of text appears?
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
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
-
- Posts: 2
- Joined: Thu Dec 16, 2010 3:14 pm
How do I wait until a string of text appears?
Sorry for the newbie question, but I am having trouble figuring out how to make iMacros wait for a string of text to appear. I have a script running on an online voting page. I want iMacros to wait until the text "Thanks for your vote" appears. Sometimes it takes a fraction of a second for the vote to register and the text to appear, while other times it takes as long as 20 seconds. I know I can use the WAIT SECONDS=x command using a large value for x, but this will make for very slow voting. Any suggestions are appreciated. 

Re: How do I wait until a string of text appears?
For such task I use extracting some text on results page.
Code: Select all
SET !TIMEOUT_TAG 10
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=DIV ATTR=TXT:Thanks* EXTRACT=TXT
-
- Posts: 2
- Joined: Thu Dec 16, 2010 3:14 pm
Re: How do I wait until a string of text appears?
Thank you! It works! 

Re: How do I wait until a string of text appears?
Hello.
I am struggling with a macro for a dynamic, javascript-heavy page, and the above technique is not working for me.
On my page, when I click some text "[ Select ]", it instantly changes to "[ Processing ]" before becoming "[ Selected ]".
After clicking "[ Select ]", I want the macro to wait until "[ Selected ]" appears before moving to the next step without using a WAIT step. The above solution sounds ideal, but I am seeing some weird behavior.
I tested that that I identified the correct POS value as follows:
This was successful: the step successfully extracts "[ Selected ]"
As per the above example, I then tried to make it specific to the required text "[ Selected ]"
But this fails!
It is as though it can only sometimes read what the text is.
Any suggestions on what I'm doing wrong?
I'm using FF 44.0.2 on Windows 8.1. iMacros build 8961227
Thank you!
I am struggling with a macro for a dynamic, javascript-heavy page, and the above technique is not working for me.
On my page, when I click some text "[ Select ]", it instantly changes to "[ Processing ]" before becoming "[ Selected ]".
After clicking "[ Select ]", I want the macro to wait until "[ Selected ]" appears before moving to the next step without using a WAIT step. The above solution sounds ideal, but I am seeing some weird behavior.
I tested that that I identified the correct POS value as follows:
Code: Select all
WAIT SECONDS=30
TAG POS=16 TYPE=TD ATTR=TXT:* EXTRACT=TXT
As per the above example, I then tried to make it specific to the required text "[ Selected ]"
Code: Select all
TAG POS=16 TYPE=TD ATTR=TXT:"[ Selected ]" EXTRACT=TXT
It is as though it can only sometimes read what the text is.
Any suggestions on what I'm doing wrong?
I'm using FF 44.0.2 on Windows 8.1. iMacros build 8961227
Thank you!
Re: How do I wait until a string of text appears?
Try with:saki wrote:Hello.
I am struggling with a macro for a dynamic, javascript-heavy page, and the above technique is not working for me.
On my page, when I click some text "[ Select ]", it instantly changes to "[ Processing ]" before becoming "[ Selected ]".
After clicking "[ Select ]", I want the macro to wait until "[ Selected ]" appears before moving to the next step without using a WAIT step. The above solution sounds ideal, but I am seeing some weird behavior.
I tested that that I identified the correct POS value as follows:This was successful: the step successfully extracts "[ Selected ]"Code: Select all
WAIT SECONDS=30 TAG POS=16 TYPE=TD ATTR=TXT:* EXTRACT=TXT
As per the above example, I then tried to make it specific to the required text "[ Selected ]"But this fails!Code: Select all
TAG POS=16 TYPE=TD ATTR=TXT:"[ Selected ]" EXTRACT=TXT
It is as though it can only sometimes read what the text is.
Any suggestions on what I'm doing wrong?
I'm usingThank you!Code: Select all
FF 44.0.2 on Windows 8.1. iMacros build 8961227
Code: Select all
TAG POS=16 TYPE=TD ATTR=TXT:[<SP>Selected<SP>] EXTRACT=TXT
Code: Select all
TAG POS=16 TYPE=TD ATTR=TXT:*[*Selected*]* EXTRACT=TXT
Code: Select all
TAG POS=16 TYPE=TD ATTR=TXT:*Selected* EXTRACT=TXT
'!TIMEOUT_TAG' is now deprecated, even if it still works, and has been replaced a few years ago already by '!TIMEOUT_STEP'...
Last edited by chivracq on Fri Mar 04, 2016 5:08 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Re: How do I wait until a string of text appears?
Thanks chivracq.
Unfortunately I get the same problem - the #EANF# extract error.
Given I can extract "[ Selected ]" sucessfully when ATTR=TXT:* I find it very strange it's not working
Anything else I can try?
Unfortunately I get the same problem - the #EANF# extract error.
Given I can extract "[ Selected ]" sucessfully when ATTR=TXT:* I find it very strange it's not working
Anything else I can try?
Re: How do I wait until a string of text appears?
Hum, strange, it should work...saki wrote:Thanks chivracq.
Unfortunately I get the same problem - the #EANF# extract error.
Given I can extract "[ Selected ]" sucessfully when ATTR=TXT:* I find it very strange it's not working
Anything else I can try?
Are you sure about the POS=16...? That doesn't sound very reliable, try using some Relative Positioning to lower the POS Number, and/or some other Attribute(s).
Because it is 'POS=16' with 'TXT:*', but it probably becomes 'POS=1' with 'TXT:*Selected*'...
Can you post your '!TIMEOUT_xxx' Settings...?
Can't you post the URL...?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Re: How do I wait until a string of text appears?
Really appreciate your help on this.
I'm not hitting Timeout limits, and although POS=16 sounds odd (indeed, took me a little while to find it), it is reliable - the text is in a table that has 8 columns. POS=16 because it's the end of the second row.
It's a password protected site, but I would be happy to share with you privately if you advised the best way to get you my credentials?
I'm not hitting Timeout limits, and although POS=16 sounds odd (indeed, took me a little while to find it), it is reliable - the text is in a table that has 8 columns. POS=16 because it's the end of the second row.
It's a password protected site, but I would be happy to share with you privately if you advised the best way to get you my credentials?
Re: How do I wait until a string of text appears?
Yep, but again;saki wrote:Really appreciate your help on this.
I'm not hitting Timeout limits, and although POS=16 sounds odd (indeed, took me a little while to find it), it is reliable - the text is in a table that has 8 columns. POS=16 because it's the end of the second row.
It's a password protected site, but I would be happy to share with you privately if you advised the best way to get you my credentials?
Because it is 'POS=16' with 'TXT:*', but it probably becomes 'POS=1' with 'TXT:*Selected*'...
I would be surprised if all 16 Cells all contain the Text 'Selected'...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Re: How do I wait until a string of text appears?
Ah ha! That works!
I thought that the POS value was static, not dependent on the text string.
So helpful! Thanks Chivracq!
I thought that the POS value was static, not dependent on the text string.
So helpful! Thanks Chivracq!
Re: How do I wait until a string of text appears?
Hahan...!! Beh..., no!, all Parameters and Attributes count when locating some HTML Element, that's the "aim of the game"...!saki wrote:Ah ha! That works!
I thought that the POS value was static, not dependent on the text string.
So helpful! Thanks Chivracq!
You actually used the "Technique" with Wildcards in some odd "the other way around' way, you normally start by tagging your Element with all Attributes and it usually gets 'POS=1' but if you then use Wildcard(s) for any Parameter(s)/Attribute(s), then you often have to adjust 'POS=1' to 'POS=2 / 3 / 4 / ... / 16...!'. But you started from the other Side of the path...
OK, glad it works and that I could help you...

- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...