Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

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
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

Post by chivracq » Sun May 02, 2021 5:57 am

sohil14 wrote:
Sun May 02, 2021 5:15 am
I am creating an Imacro for some work but I am new to this platform and
cant understand many things. I want my macro to find a particular text like
"18-19" and alert me when that text is found.
I want this in a 30 minute loop so can someone provide me with a code that
I can copy or provide me reference . I have tried a lot to find about this
but am confused what is TAG and what is Extract! and SEARCH and how these
are different.

link to existing thread : viewtopic.php?f=2&t=27130&sid=a88cf4eeb8983388fb3

Code: Select all

Built Version=10.1.0 freeware
Windows 10 Home
Brave 1.23.75

Alright, good, you finally "made it", ah-ah...!, after 3 Disapprovals, oops...! :wink:

One more "Thing" though, can you still correct the ugly Typo about "notifaction" :shock: in your Thread Tile...? :!:
Already corrected in my Reply...
=> Correct Spelling is "notification"..., and nobody is going to search the Forum with your "creative" Spelling, ah-ah...! :P

Hum, interesting to know that iMacros for CR v10.1.0 can also be installed on the 'Brave' Browser, I didn't know actually...! 8)

>>>

And then to answer your Qt/Scenario, well..., no URL posted, I will give you the same Answer like the Answer and first Reply I gave 4 years ago in the relevant/similar Thread you linked to...:
- Re: Can Imacros Search like CTRL + F and play an alert when find
(Correct Link btw, yours got "a bit broken" through several Copy&Paste's and is not "directly" clickable...)

4 years later, my Answer is still correct, and especially the following part, for your Scenario: :idea:
chivracq wrote:
Sun Jan 15, 2017 7:23 pm
But often, simply trying to tag (and extract) your Element(s) is the simplest way...

For playing a Sound upon finding your Element(s), search my Posts on "Conditional Sound", I've posted several times a Solution...
- (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: Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

Post by chivracq » Mon May 03, 2021 4:58 am

sohil14 wrote:
Sun May 02, 2021 6:24 am
Code;

Code: Select all

TAG POS=1 TYPE=DIV ATTR=TXT:Age<SP>18+
I want to find if there is "18+" in the website.
And if 18+ is found play a sound or a notification pop up.
And I don't know what will be the output and how to use that output and what variable will contain that output to paly sound/notification.
>>>
sohil14 wrote:
Sun May 02, 2021 8:04 am

Code: Select all

VERSION BUILD=1010 RECORDER=CR
URL GOTO=https://www.cowin.gov.in/home
TAG POS=1 TYPE=DIV ATTR=_NGCONTENT-XEA-C68:&&DATA-UNCHECKED:Search<SP>By<SP>PIN&&DATA-CHECKED:Search<SP>By<SP>District&&CLASS:status-switch
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:https://www.cowin.gov.in/home ATTR=ID:status CONTENT=YES
TAG POS=1 TYPE=DIV ATTR=CLASS:mat-select-arrow-wrapper<SP>ng-tns-c64-1
TAG POS=1 TYPE=SPAN ATTR=TXT:West<SP>Bengal
TAG POS=1 TYPE=DIV ATTR=CLASS:mat-select-arrow<SP>ng-tns-c64-3
TAG POS=1 TYPE=SPAN ATTR=TXT:Howrah
TAG POS=1 TYPE=BUTTON FORM=ACTION:https://www.cowin.gov.in/home ATTR=TXT:Search
TAG POS=1 TYPE=TD ATTR=TXT:Age<SP>45+
TAG POS=R1 TYPE=COLSPAN ATTR=TXT:Age<SP>45+ EXTRACT=TXT
SET !EXTRACT "Age 45+"
SET FirstWord EVAL("var s=\"{{!EXTRACT}}\"; s.split(\" \", 2);")
SET !VAR1 EVAL("if (\"{{FirstWord}}\" == \"Age 45+\") {var s = 'file://';} else {var s = \"\";} s;")
SET !VAR2 EVAL("if (\"{{FirstWord}}\" == \"Age 45+\") {var s = 'E:/.iPhone 6 Plus Original Ringtone.wav';} else {var s = \"\";} s;")
URL GOTO={{!VAR1}}{{!VAR2}}

Although Age 45+ present in page it shows not found and stops

Oh yeah...!, perfect with the full Scrip, "now I can help you", ah-ah...!

Only had a mini Look, the 'file:///' Protocol needs 3 Forward Slashes, you only have 2, that could be a Pb..., even if "some" Browsers accept only 2 '//'...
... And the 'EVAL()' for your 'FirstWord' Var is "a bit useless", it does nothing...!
... But further your Code looked OK to me..., from a quick Look, even if you don't use "my Syntax" for 'EVAL()', I didn't try to debug it..., further than "mentally"... :wink:

And then, was a bit busy myself, WE oops..., will have a Look further "tomorrow", after some "Sleep", ah-ah...! :wink:
(DJ IRL so I often get Gigs or Friends visiting during the WE...) :P
- (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: Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

Post by chivracq » Mon May 03, 2021 5:57 am

sohil14 wrote:
Mon May 03, 2021 5:25 am
Thanks for replying it means a lot sir.
I de bugged it as you said but now I search for 18+ and it is not present in the website and the music is played for it too.
I actually want this in a loop running in background every 30 mins if no output comes every 30 mins the code will be played again.
Please can you help a little in that. :D :D

Code: Select all

VERSION BUILD=1010 RECORDER=CR
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
URL GOTO=https://www.cowin.gov.in/home
TAG POS=1 TYPE=DIV ATTR=_NGCONTENT-XEA-C68:&&DATA-UNCHECKED:Search<SP>By<SP>PIN&&DATA-CHECKED:Search<SP>By<SP>District&&CLASS:status-switch
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:https://www.cowin.gov.in/home ATTR=ID:status CONTENT=YES
TAG POS=1 TYPE=DIV ATTR=CLASS:mat-select-arrow-wrapper<SP>ng-tns-c64-1
TAG POS=1 TYPE=SPAN ATTR=TXT:West<SP>Bengal
TAG POS=1 TYPE=DIV ATTR=CLASS:mat-select-arrow<SP>ng-tns-c64-3
TAG POS=1 TYPE=SPAN ATTR=TXT:Howrah
TAG POS=1 TYPE=BUTTON FORM=ACTION:https://www.cowin.gov.in/home ATTR=TXT:Search
TAG POS=1 TYPE=DIV ATTR=TXT:Age<SP>18+
TAG POS=R1 TYPE=COLSPAN ATTR=TXT:Age<SP>18+ EXTRACT=TXT
SET !EXTRACT "Age 18+"
SET !VAR1 EVAL("if (\"{{!EXTRACT}}\" == \"Age 18+\") {var s = 'file:///';} else {var s = \"\";} s;")
SET !VAR2 EVAL("if (\"{{!EXTRACT}}\" == \"Age 18+\") {var s = 'E:/iphone.wav';} else {var s = \"\";} s;")
URL GOTO={{!VAR1}}{{!VAR2}}

Yeah OK, I don't really understand your Sentence...:
"I de bugged it as you said but now I search for 18+ and it is not present in the website and the music is played for it too."
=> If you could rephrase it...?

Then OK about your Script, but same Version like in your previous Reply...? , mention the Change(s) otherwise..., if it's the same Script, you don't need to post it every time now, pity you didn't do that in your OP, then you probably already have your Solution by now... :|

(Pretty late "for me" on a Sunday Eve/Night, after some "long" WE, going to sleep soon, I'll check the Forum "tomorrow", ah-ah...! :wink: )
- (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: Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

Post by chivracq » Mon May 03, 2021 8:27 pm

sohil14 wrote:
Mon May 03, 2021 6:06 am
Means the 2 things you said to change and I tried to experiment with it a little and try things that caused the probable error. But no use. The code given plays sound no matter if the word is present or not that's the main error and I can't find the mistake maybe really silly buy I'm even more silly. If you could check the probable mistake why it plays for any word no matter if it is present or not. That would be of great help. :D

Alright, then yep, "normal"...!: Your "SET !EXTRACT "Age 18+"" is meant to "debug" your Script to check/test/confirm that the 2x 'EVAL()' Statements work as expected, but then you need to comment out that Line in order to use the "real" 'EXTRACT' from the previous Line in your Script (TAG POS=R1 TYPE=COLSPAN ATTR=TXT:Age<SP>18+ EXTRACT=TXT)... :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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can Imacros search like CTRL+F and alert me with a notification or sound when a particular text is found.

Post by chivracq » Thu May 06, 2021 10:44 pm

Alright, and...?, any Update...?
You don't need more than 3 days now to add a _'_ in front of a Line to comment it out, I would think...!? :o
- (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