How to use IF ELSE?

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
z900
Posts: 2
Joined: Tue Sep 28, 2021 5:28 am

How to use IF ELSE?

Post by z900 » Tue Sep 28, 2021 5:40 am

i want to search txt name in facebook groups
If found, stop loop.
If not found, continue refresh.

Code: Select all

URL GOTO=https://www.facebook.com/groups
IF (TAG POS=1 TYPE=* ATTR=TXT:"name txt") {
PAUSE
}
ELSE{
REFRESH
}
windows10
Google Chrome
iMacros for Chrome 10.1.1
Last edited by chivracq on Tue Sep 28, 2021 9:31 am, edited 1 time in total.
Reason: Thread moved to the 'Data Extraction' Sub-Forum + Thread Title edited to add a '?', User is not sharing a 'How-to'.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to use IF ELSE?

Post by chivracq » Tue Sep 28, 2021 9:38 am

z900 wrote:
Tue Sep 28, 2021 5:40 am
i want to search txt name in facebook groups
If found, stop loop.
If not found, continue refresh.

Code: Select all

URL GOTO=https://www.facebook.com/groups
IF (TAG POS=1 TYPE=* ATTR=TXT:"name txt") {
PAUSE
}
ELSE{
REFRESH
}

Code: Select all

windows10
Google Chrome
iMacros for Chrome 10.1.1

I moved and edited your Post as you can see...:
Thread moved to the 'Data Extraction' Sub-Forum + Thread Title edited to add a '?', User is not sharing a 'How-to'.

And then OK, good, you've added your FCI after I had approved your Post, but hum, 'Free'/'PE'/'Trial' is still missing about v10.1.1 for CR, and your Browser Version is also missing, => probably CR93...?

Then hum..., I usually don't help for Social Media, but the Functionality that you want is "generic" enough. then OK...
=> Thread moved to the 'Data Extraction' already gives you the "first Part" of the/a Solution/Implementation, => you will need the 'EXTRACT' Mechanism, + 'EVAL()' for the 'IF/ELSE' Condition, and 'MacroError()' to abort the Script. :idea:

Another Solution/Implementation would be to use the 'EVENT' Param from the 'TAG' Command, + the 'FAIL_IF_FOUND' Option. :idea:
(And that Command doesn't even need any 'IF/ELSE'...)

+ For both Options, you may want to shorten '!TIMEOUT_STEP' if you don''t want each Loop to "wait" for the Default 6 Sec, and if you use '!ERRORIGNORE' (not needed in Combination with 'EXTRACT' though), it needs to be disabled for 'MacroError()' to abort the Script... :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...
z900
Posts: 2
Joined: Tue Sep 28, 2021 5:28 am

Re: How to use IF ELSE?

Post by z900 » Tue Sep 28, 2021 1:12 pm

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

Re: How to use IF ELSE?

Post by chivracq » Tue Sep 28, 2021 1:27 pm

z900 wrote:
Tue Sep 28, 2021 1:12 pm
Thanks you
Regards,

Hum, OK for the Follow-up, but "Thank[s] you" alone still doesn't mention the Bits of Data I said were missing from your FCI... :?

And "expected Use of the Forum" (=> "(Advanced) Users helping Users") would be that you post your (final/working) Script to show how you implemented the Functionality that you want, in order to make this Thread also useful for other Users... :idea:

>>>

EDIT: (about 2 months later: [2021-11-23])
No Follow-up from @OP anymore, => hum..., OK, fair enough... :(

... But I'll probably won't help you anymore @OP if you "ever" need some Help again on the Forum, ... or you'll have to finish this one "correctly" then, ... and then have to wait for the same amount of time "we" had to wait for your Share of your Final Script... :|
=> You already have a '+2 Month' "Credit" from me to answer any "future" Thread of yours on the Forum, just saying... :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...
Post Reply