Auto-Click button until a specific text appear

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
DeAtH
Posts: 5
Joined: Mon Dec 13, 2021 10:06 pm

Auto-Click button until a specific text appear

Post by DeAtH » Mon Dec 13, 2021 10:11 pm

I'm trying to make an auto-click to a button on a website and return; when a specific text appears on the page (not click it)

Here is my simple codes:

Code: Select all

HTML:
    <span class="tr-country" data-tr="IQ">Iraq</span>
    <i class="flag message-flag flags-IQ"></i>

    iMacros Recorder:
    VERSION BUILD=1011 RECORDER=CR
    URL GOTO=https://ometv.chat/
    FRAME F=1
    TAG POS=2 TYPE=DIV ATTR=TXT:next
    TAG POS=2 TYPE=SPAN ATTR=TXT:South<SP>Africa (Some Random Country)
    TAG POS=1 TYPE=I ATTR=CLASS:flag<SP>message-flag<SP>flags-ZA
What I want is to check if the class "tr-country" has the data-tr of "IQ" then we don't click "next" button

How can I do that in a condition way?

Thanks in advance.

FCI:
iMacros for Chrome 10.1.1 Free
Windows 10 English
Version 96.0.4664.93 (Official Build) (64-bit)
Last edited by DeAtH on Tue Dec 14, 2021 6:01 am, edited 2 times in total.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Auto-Click button until a specific text appear

Post by chivracq » Tue Dec 14, 2021 2:34 am

DeAtH wrote:
Mon Dec 13, 2021 10:11 pm
I'm trying to make an auto-click to a button on a website and return; when a specific text appears on the page (not click it)

Here is my simple codes:
HTML:

Code: Select all

<span class="tr-country" data-tr="IQ">Iraq</span>
<i class="flag message-flag flags-IQ"></i>
iMacros Recorder:

Code: Select all

    VERSION BUILD=1011 RECORDER=CR
    URL GOTO=https://ometv.chat/
    FRAME F=1
    TAG POS=2 TYPE=DIV ATTR=TXT:next
    TAG POS=2 TYPE=SPAN ATTR=TXT:South<SP>Africa (Some Random Country)
    TAG POS=1 TYPE=I ATTR=CLASS:flag<SP>message-flag<SP>flags-ZA
What I want is to check if the class "tr-country" has the data-tr of "IQ" then we don't click "next" button

How can I do that in a condition way?

Thanks in advance.

Grrr..., fairly Low Quality Thread, both on our Forum (you didn't read the Forum Rules for Required Tech Info to include in your OP when you open a Thread), and in your parallel Thread on 'SOF': :(
- Auto Click a button until a specific text appear in page using iMacros

'iMacros for CR' Sub-Forum selected for our Forum, + `google-chrome-extension` Tag selected on 'SOF', + "VERSION BUILD=1011 RECORDER=CR", then OK, "we" can "conclude" I "hope" you are on CR...
=> Moving your Thread to the 'Data Extraction' Sub-Forum, it has nothing specific to the 'iMacros for CR' one, especially if you don't even mention your FCI... :!:

+ FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for CR v10.1.1, 'Free'/'PE'/'Trial'...?, CR96...?, OS...?

Same about your Qt on 'SOF', check the 'iMacros Tag Wiki' on how to ask Qt's about iMacros "correctly"... (I wrote that Tag Wiki, ah-ah...! :P ) :idea:
(Fine with me to open parallel Threads on different Forums, but you (will) need to provide the same Quality on all, and maintain/follow up on all... :| )

>>>

I'm nearly impressed btw that you managed to find the 4x Spaces for Code Formatting on SOF, not needed on our Forum, from your "lazy" Copy&Paste... :wink:
:arrow: "Easier" if you want to post on both Forums/Sites, is to first post on our Forum, then you can format your Code easily for SOF by simply adding 3x Backticks at the Beginning + End of your Code Block, on a separate Line... (No Need for the 4x Spaces at the Beginning of each Line then...) Example: :idea:

Code: Select all

```
VERSION BUILD=1011 RECORDER=CR
URL GOTO=https://ometv.chat/
'... Etc...
```
=> Will be displayed on SOF as: 8)

Code: Select all

VERSION BUILD=1011 RECORDER=CR
URL GOTO=https://ometv.chat/
'... Etc...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
DeAtH
Posts: 5
Joined: Mon Dec 13, 2021 10:06 pm

Re: Auto-Click button until a specific text appear

Post by DeAtH » Tue Dec 14, 2021 6:11 am

chivracq wrote:
Tue Dec 14, 2021 2:34 am

Grrr..., fairly Low Quality Thread, both on our Forum (you didn't read the Forum Rules for Required Tech Info to include in your OP when you open a Thread), and in your parallel Thread on 'SOF': :(
- Auto Click a button until a specific text appear in page using iMacros

'iMacros for CR' Sub-Forum selected for our Forum, + `google-chrome-extension` Tag selected on 'SOF', + "VERSION BUILD=1011 RECORDER=CR", then OK, "we" can "conclude" I "hope" you are on CR...
=> Moving your Thread to the 'Data Extraction' Sub-Forum, it has nothing specific to the 'iMacros for CR' one, especially if you don't even mention your FCI... :!:

+ FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for CR v10.1.1, 'Free'/'PE'/'Trial'...?, CR96...?, OS...?

Same about your Qt on 'SOF', check the 'iMacros Tag Wiki' on how to ask Qt's about iMacros "correctly"... (I wrote that Tag Wiki, ah-ah...! :P ) :idea:
(Fine with me to open parallel Threads on different Forums, but you (will) need to provide the same Quality on all, and maintain/follow up on all... :| )
...
Hi, I apologize for having you reminding me with all this
yes I'm new here, and I firstly posted to SOF because I didn't think there's much support there at all, that's why I headed to iMacros Forum :(

Sure also I don't think my question is that hard, I'm a noobie in iMacros :(
Thank you for following up with me..
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Auto-Click button until a specific text appear

Post by chivracq » Tue Dec 14, 2021 7:35 am

DeAtH wrote:
Tue Dec 14, 2021 6:11 am
Hi, I apologize for having you reminding me with all this
yes I'm new here, and I firstly posted to SOF because I didn't think there's much support there at all, that's why I headed to iMacros Forum :(

Sure also I dont t'hink my question is that hard, I'm a noobie in iMacros :(
Thank you for following up with me..

Alright, very good, FCI posted: :D
FCI:

Code: Select all

iMacros for Chrome 10.1.1 Free
Windows 10 English
Version 96.0.4664.93 (Official Build) (64-bit)
... Let me check on SOF... :wink:
=> Oh...!?, nope..., OK, maybe not yet, but your Reply on our Forum was already from 1.5h ago, I would think you had the time to also add that Info to your parallel Thread... :o OK, well..., no Pb, I'll check again in a few hours, hum, after some sleeping now I guess... :P
I mentioned that I find it completely OK for Users to start parallel Threads on different Tech Forums, but that they then have to follow up on all Threads/Forums and provide the same Quality on all of them... More Audience to reach, but also more "Work" to maintain all the Threads, ah-ah...! (And if one gets deleted, then oops...!, I stop helping "everywhere", ah-ah...!)

Hum, and be "careful" with that kind of Saying: "I dont t'hink my question is that hard"...
=> When I see/read that, that only means to me: = "Hum, OK, the User didn't read any Documentation (confirmed already by not reading the Forum Rules on this Forum, the Tag Wiki on SOF is a bit "hard" to find...) and didn't try anything at all by themselves..."

Your Qt/Scenario has already been asked/posted hundreds of times on the Forum btw, ah-ah...! :P
And I had already posted the "Best" Solution for that Scenario, => 8 years ago...! :twisted: , that works in 99% of the Cases, ah-ah...! :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
DeAtH
Posts: 5
Joined: Mon Dec 13, 2021 10:06 pm

Re: Auto-Click button until a specific text appear

Post by DeAtH » Tue Dec 14, 2021 10:34 am

chivracq wrote:
Tue Dec 14, 2021 7:35 am
... Let me check on SOF... :wink:
=> Oh...!?, nope..., OK, maybe not yet, but your Reply on our Forum was already from 1.5h ago, I would think you had the time to also add that Info to your parallel Thread... :o OK, well..., no Pb, I'll check again in a few hours, hum, after some sleeping now I guess... :P
I mentioned that I find it completely OK for Users to start parallel Threads on different Tech Forums, but that they then have to follow up on all Threads/Forums and provide the same Quality on all of them... More Audience to reach, but also more "Work" to maintain all the Threads, ah-ah...! (And if one gets deleted, then oops...!, I stop helping "everywhere", ah-ah...!)

Hum, and be "careful" with that kind of Saying: "I dont t'hink my question is that hard"...
=> When I see/read that, that only means to me: = "Hum, OK, the User didn't read any Documentation (confirmed already by not reading the Forum Rules on this Forum, the Tag Wiki on SOF is a bit "hard" to find...) and didn't try anything at all by themselves..."

Your Qt/Scenario has already been asked/posted hundreds of times on the Forum btw, ah-ah...! :P
And I had already posted the "Best" Solution for that Scenario, => 8 years ago...! :twisted: , that works in 99% of the Cases, ah-ah...! :idea:
As you want I'll do that on both :D I actually care more here and I think I'll get better help here... not sure if SOF was the right place

No I didn't mean that, I meant like I need to understand how conditions work in iMacros, I've read the Command_Reference, still I don't understand it (specially I'm just using iMacros extension not the software)

If this was asked exactly the same scenario I have, would you mind guiding me with this? because I've looked it up before asking :(
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Auto-Click button until a specific text appear

Post by chivracq » Tue Dec 14, 2021 9:57 pm

DeAtH wrote:
Tue Dec 14, 2021 10:34 am
As you want I'll do that on both :D I actually care more here and I think I'll get better help here... not sure if SOF was the right place

Alright, saw that, (about adding your FCI on your Thread on SOF), perfect, Thanks... :D

Oh...!, btw, one more "Detail" about Text/Code Formatting on SOF, I'm not sure if you wanted to post your FCI "Block" in 1 Line, or in 2 Lines (got displayed as 1 Line), but you need to add 2x Spaces at the End of a Line for a Return to be executed within a same "Paragraph", or a Returns gets otherwise "converted" into a Space... Yep, I know the Formatting is a bit "awkward" and cumbersome on SOF, but that's "the Way it is", ah-ah...! No Comment...! :|

>

About "I actually care more here and I think I'll get better help here... not sure if SOF was the right place":
=> Well, I "monitor" and answer Threads/Qt's on both Forums/Sites, and I guess if I had "started" to answer your Qt on SOF first, you would probably "care more there", ah-ah...! :wink:

And about "not sure if SOF was the right place", well..., it is sometimes, (or I wouldn't have gone through the "Hassle" of creating the iMacros Tag Wiki to increase the Quality on QT's/Threads on that Site... :P ), but SOF is about "straightforward" Q&A Threads, which actually is "the Case" for your Scenario, as the "Solution" for your Scenario will be to apply some "straightforward" Mechanism, but I usually prefer to answer on "our" Forum, for several Reasons...:

- I find the Site completely Buggy and annoying to use, the Developers keep "experimenting" with all kinds of "new Tricks" and new "fake Technology" with some Func getting broken every 2 weeks, especially in the "older" Browsers I use myself, precisely because of their proven Reliability with Web-Automation and iMacros. Since a few days, half of the Site is now completely broken for me and doesn't work anymore in any of the Browsers I use, I can't vote anymore, I can't comment, and I can't edit, so that's a bit of a "Show-Killer", ah-ah...! :roll:

- I don't like the Reputation System on the Site and the Obligation to be "nice", I care about Quality and helping Users who really get stuck after already trying their "Best" to find a Solution by themselves, and I can "enforce" Quality much more easily on our Forum, + also from being a Mod here, I can quickly edit (or even delete) all Posts if needed, for Spam/Formatting/removing some "excessive" Quoting for Readability/(more) Descriptive Thread Title, etc..., while I usually have to wait for 2 days on SOF for some Edit to eventually/hopefully get accepted by some High-Rep User who won't know anything about iMacros...

- New Users on that Site (= 1-Rep Users like you) rarely follow up/upvote/accept Answers, or even "worse" often delete their Qt/Thread (and my Answer with it :shock: ) once they get their Answer/Solution/Script working (to prevent the "Competition" from using the same Script), which is also a "Waste" of Time and Energy for me, while "you" won't be able to delete your Thread here... (Main Reason why I "systematically" quote, even if you "mutilate" all your Posts "later", the Thread will remain "readable" and usable/useful for other Users with a similar Qt/Scenario...

- And 1 more "important" Reason is that I usually don't write "straight Answers/Solutions" like the Site "expects" and I usually don't write their Script for other Users, but rather "guide them" and "let them find the/a Solution/Implementation" by themselves, which I find more "rewarding" for those Users and they will "learn and progress" much more quickly, and "normally" after helping them maybe 3 times, they won't need my Help anymore for whatever later Func or Qt they might have in the Future... :twisted:

Alright, that was a bit of a "Verbose" Explanation/Feedback, ah-ah...! :oops: :wink: :shock:

>>>
DeAtH wrote:
Tue Dec 14, 2021 10:34 am
No I didn't mean that, I meant like I need to understand how conditions work in iMacros, I've read the Command_Reference, still I don't understand it (specially I'm just using iMacros extension not the software)

If this was asked exactly the same scenario I have, would you mind guiding me with this? because I've looked it up before asking :(

Alright, here is the "Starting Point" for you, and the Thread I was referring to "from 8 years ago"...: :idea:
- Re: Decision Making using iMacros/Possible Workarounds

The first Solution I explained in that Post/Thread ('Relative Positioning') would be the "Solution that works in 99% of the Cases", if your Scenario was "Auto-Click button IF/WHEN a specific text appear[s]", BUT...!, too bad...!, you want the "opposite" Scenario: "Auto-Click button UNTIL a specific text appear[s]", so that won't work in your Case, oops...! Hum, OK, maybe I should lower my "99%" to "95%", ah-ah...!, Okay...! :P

Then you'll need to use the second Solution/Implementation I mentioned, => by using the `EXTRACT` Mechanism, + `EVAL()` to spit out a "2"/"0" for your "TAG POS=2 TYPE=DIV ATTR=TXT:next" to click on that "next" Button only with "POS=2", and "POS=0" won't do anything... :idea:

Alright, I let you "sweat a bit" and (try to) implement that Func yourself after you understand how the Mechanism/Principle works... :P
... And read the rest of the Thread, it contains much more Info, and a List of relevant Threads, all with many Examples and different Implementations of that "Technique"... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
DeAtH
Posts: 5
Joined: Mon Dec 13, 2021 10:06 pm

Re: Auto-Click button until a specific text appear

Post by DeAtH » Thu Dec 16, 2021 7:45 am

chivracq wrote:
Tue Dec 14, 2021 9:57 pm
Alright, here is the "Starting Point" for you, and the Thread I was referring to "from 8 years ago"...: :idea:
- Re: Decision Making using iMacros/Possible Workarounds

The first Solution I explained in that Post/Thread ('Relative Positioning') would be the "Solution that works in 99% of the Cases", if your Scenario was "Auto-Click button IF/WHEN a specific text appear[s]", BUT...!, too bad...!, you want the "opposite" Scenario: "Auto-Click button UNTIL a specific text appear[s]", so that won't work in your Case, oops...! Hum, OK, maybe I should lower my "99%" to "95%", ah-ah...!, Okay...! :P

Then you'll need to use the second Solution/Implementation I mentioned, => by using the `EXTRACT` Mechanism, + `EVAL()` to spit out a "2"/"0" for your "TAG POS=2 TYPE=DIV ATTR=TXT:next" to click on that "next" Button only with "POS=2", and "POS=0" won't do anything... :idea:

Alright, I let you "sweat a bit" and (try to) implement that Func yourself after you understand how the Mechanism/Principle works... :P
... And read the rest of the Thread, it contains much more Info, and a List of relevant Threads, all with many Examples and different Implementations of that "Technique"... :idea:
I understand the concept behind this, and here's what I tried:

Code: Select all

VERSION BUILD=1011 RECORDER=CR
URL GOTO=https://ometv.chat/
SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq
TAG POS=R-1 TYPE=SPAN ATTR=TXT:* EXTRACT=TXT
'SET !VAR1 EVAL() //Spit out a 1 only for 30L...
SET !VAR1 {{!EXTRACT}}
ADD !VAR1 -29
'PROMPT {{!VAR1}}
'...
SET !TIMEOUT_STEP 1
TAG POS={{!VAR1}} TYPE=DIV ATTR=TXT:next
As you mentioned in the second solution, this takes the the value and do weird stuff with it

this code resulted to:
RuntimeError: element SPAN specified by TXT:Iraq was not found, line: 4
THATS THE POINT!
If the text "Iraq" exists, then it should stop the macro
If it doesn't, processed to "Tag next" button and have the macro on loop

Also these are the elements that tells we connected with someone from "Iraq for example":

Code: Select all

<span class="tr-country" data-tr="IQ">Iraq</span>
<i class="flag message-flag flags-IQ"></i>
I can just extract either one of these values to know if I'm connected with "IQ"

Thanks in advance :(
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Auto-Click button until a specific text appear

Post by chivracq » Fri Dec 17, 2021 7:32 pm

DeAtH wrote:
Thu Dec 16, 2021 7:45 am
I understand the concept behind this, and here's what I tried:

Code: Select all

VERSION BUILD=1011 RECORDER=CR
URL GOTO=https://ometv.chat/
SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq
TAG POS=R-1 TYPE=SPAN ATTR=TXT:* EXTRACT=TXT
'SET !VAR1 EVAL() //Spit out a 1 only for 30L...
SET !VAR1 {{!EXTRACT}}
ADD !VAR1 -29
'PROMPT {{!VAR1}}
'...
SET !TIMEOUT_STEP 1
TAG POS={{!VAR1}} TYPE=DIV ATTR=TXT:next
As you mentioned in the second solution, this takes the the value and do weird stuff with it

this code resulted to:
RuntimeError: element SPAN specified by TXT:Iraq was not found, line: 4
THATS THE POINT!
If the text "Iraq" exists, then it should stop the macro
If it doesn't, processed to "Tag next" button and have the macro on loop

Also these are the elements that tells we connected with someone from "Iraq for example":

Code: Select all

<span class="tr-country" data-tr="IQ">Iraq</span>
<i class="flag message-flag flags-IQ"></i>
I can just extract either one of these values to know if I'm connected with "IQ"

Thanks in advance :(

Hum..., alright, yeah..., you copied a bit "blindly" the Example from that Thread but you didn't "really" understand the Principle, I'm afraid... :(

In that Example/Case, my `EXTRACT` was "already" extracting Numbers (Integers in Range [0-30] or [1-30], I don't remember), and that Case was so "lucky", that I didn't even have to use `EVAL()` because I only wanted to spit out a "1" when my `EXTRACT`="30", so I had resorted to some "simplistic" Shortcut Trick with an "ADD -29" (=> 30-29=1), all other Cases with `EXTRACT`<30 would result in '!VAR1'<=0, and "POS=0" or "POS=Negative_Nb" wouldn't do anything...

But in your Case, first you need to apply the `EXTRACT` to the "correct" `TAG` Statement, ah-ah...! (=> "TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq EXTRACT=TXT") will extract/return a String (and not a Nb like in my Case), => "Iraq" if that Element is present on the Page, or "#EANF#" if the Element is not found like in your "RuntimeError: element SPAN specified by TXT:Iraq was not found, line: 4" Case...

Then you only need some simple `if/else` Condition in `EVAL()` to return "1"/"0" to reuse on "POS=n" to decide if your Script will need to click on the "Next" Button, + also maybe on the "Irak" Link/Button... (The `EXTRACT` Command used previously prevents iMacros from clicking on an Element if that Element is clickable... :!: )

And that would give stg like:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq EXTRACT=TXT
SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z; if(s=='Iraq'){z=1;} else{z=0;}; z;")
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_<BR>VAR1:<SP>_{{!VAR1}}_
PAUSE

TAG POS={{!VAR1}} TYPE=SPAN ATTR=TXT:Iraq
TAG POS={{!VAR1}} TYPE=DIV ATTR=TXT:next
... And I usually prefer to run the Check "negatively" on "#EANF#", which gives a more "generic" Expression that can most of the time be "blindly" copied&pasted with no to little Modification, like in:

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq EXTRACT=TXT
'SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z; if(s=='Iraq'){z=1;} else{z=0;}; z;")
SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z; if(s!='#EANF#'){z=1;} else{z=0;}; z;")
PROMPT EXTRACT:<SP>_{{!EXTRACT}}_<BR>VAR1:<SP>_{{!VAR1}}_
PAUSE

TAG POS={{!VAR1}} TYPE=SPAN ATTR=TXT:Iraq
TAG POS={{!VAR1}} TYPE=DIV ATTR=TXT:next
... But the Result/Behaviour will be the same... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Auto-Click button until a specific text appear

Post by chivracq » Mon Dec 20, 2021 10:39 pm

The Follow-up is "a bit slow" I would say, 2 days on my previous Post with a simple "blind" C&P of some Example I linked to as "Result"..., without really understanding how to adapt that Example... :o , and now 3 days on my last Post with still no Follow-up, while I gave you the "more or less" complete Solution... :( :o
=> Any Progress/Follow-up...? :?:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
DeAtH
Posts: 5
Joined: Mon Dec 13, 2021 10:06 pm

Re: Auto-Click button until a specific text appear

Post by DeAtH » Wed Jan 19, 2022 10:19 pm

chivracq wrote:
Mon Dec 20, 2021 10:39 pm
The Follow-up is "a bit slow" I would say, 2 days on my previous Post with a simple "blind" C&P of some Example I linked to as "Result"..., without really understanding how to adapt that Example... :o , and now 3 days on my last Post with still no Follow-up, while I gave you the "more or less" complete Solution... :( :o
=> Any Progress/Follow-up...? :?:
Hi, I'm so sorry for the late response on this situation chivracq, I've moved into a new job and life is a bit different with me..

But anyways, I didn't c&p, I understand what the code was doing but I think its digging wrong

See, in the website I have another "TXT:Iraq" that exists in the source page (its hidden in a menu) and I think its being tagged..
This image will explain (https://imgur.com/a/sTMZEcc)

Code: Select all

VERSION BUILD=1011 RECORDER=CR
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !EXTRACT NULL
FRAME F=1
TAG POS=2 TYPE=DIV ATTR=TXT:start 'First click Start'
TAG POS=1 TYPE=SPAN ATTR=TXT:Iraq EXTRACT=TXT

SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z; if(s=='Iraq'){z=1;} else{z=0;}; z;")
'SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z; if(s!='#EANF#'){z=1;} else{z=0;}; z;")
'PAUSE

TAG POS={{!VAR1}} TYPE=SPAN ATTR=TXT:Iraq
TAG POS={{!VAR1}} TYPE=DIV ATTR=TXT:next
Oh I kinda don't get why you added "PAUSE" before the main event (which is tagging 'next')
and I used the first EVAL to extract that text, also it does the same result with the second EVAL extract (I think)

I appreciate you following up with me on this topic, and I'm so so sorry, life gets hard sometimes <3
Post Reply