Can Imacros Search like CTRL + F and play an alert when find

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Can Imacros Search like CTRL + F and play an alert when find

by inck243 on Sun Jan 15, 2017 11:50 am

Hello,

I downloaded imacros 9.0.3 for firefox 50.1.0 on osx 10.11.2 . I have it clicking a button over and over again but I need to constantly be watching the page for any changes.

Is there a way to make it do Find (control F) and search for a series of things I want it to find?

Example of how I want the macro to work:

Push button (page loads)
Find (control F) and searching for all of the following text in the browser: 01/17/17, 01/18/17, 01/19/17, 01/24/17 - etc. (i would change this periodically)

if it finds any one of those above dates, i want it to play a chime or something so I can go look at the page and click on something if I want to.

So can it do this? how exactly can I script that?

Thanks!!!
Last edited by inck243 on Sun Jan 15, 2017 12:24 pm, edited 1 time in total.
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by chivracq on Sun Jan 15, 2017 12:23 pm

inck243 wrote:Hello,

I downloaded imacros for firefox. I have it clicking a button over and over again but I need to constantly be watching the page for any changes.

Is there a way to make it do Find (control F) and search for a series of things I want it to find?

Example of how I want the macro to work:

Push button (page loads)
Find (control F) and searching for any one of the following text on the screen: 01/17/17, 01/18/17, 01/19/17, 01/24/17 - etc.

if it finds any one of those above dates, i want it to play a chime or something so I can go look at the page and click on something if I want to.

So can it do this? how exactly can I script that?

Thanks!!!

FCIM...! :mrgreen:
"I downloaded imacros for firefox." is not enough, read my Sig, you need to mention your FCI with all Versions when you open a Thread or post for the first time in some existing Thread, not all Commands are implemented for all Browser/Versions...
=> iMacros for FF v9.0.3...?, FF50...?, OS...?

Concerning "Search / Ctrl^f" on Firefox, there is some Thread already on the Forum about a similar Qt from a few months ago I think, I remember doing some Testing about 'Ctrl^f' on FF for this Thread. Locate the Thread and post the Link, I don't remember all the Content but that should give you already a starting point.
From what I remember, it was possible to open the Search Bar by triggering the FF 'Ctrl^f' (using the 'EVENT' Mode) but further "Actions" were more tricky...

But there are other ways as well with iMacros to conduct a Search on a Web-Page and take different Actions upon finding Elements, you have for example an iMacros 'SEARCH' Command.
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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Sun Jan 15, 2017 12:30 pm

thanks sorry i saw that when I was searching. I have imacros 9.0.3 for firefox 50.1.0 on osx 10.11.2


so if I do

SEARCH SOURCE=TXT:"'01/17/17'"

is that correct? I don't need it to actually use the CTRL F function of the browser, i just am looking for something very similar to that, to search the page for the date and alert me if it comes up
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by chivracq on Sun Jan 15, 2017 12:47 pm

inck243 wrote:thanks sorry i saw that when I was searching. I have
Code: Select all
 imacros 9.0.3 for firefox 50.1.0 on osx 10.11.2


so if I do
Code: Select all
SEARCH SOURCE=TXT:"'01/17/17'"


is that correct? I don't need it to actually use the CTRL F function of the browser, i just am looking for something very similar to that, to search the page for the date and alert me if it comes up

OK, perfect for FCI... :D

Well, about your Statement, I don't know really, I don't use this 'SEARCH' Command myself as I find it "complicated" to use and I don't like (= I don't master...! :oops: ) 'REGEXP', check the Wiki for the correct Syntax and Examples, and you'll find maybe better Examples on the Forum as well..., I think (Advanced) User @iimfun has produced a few good Code Examples...
And then you test your Statement/Script against your Site/Page..., you didn't post the URL of your Site/Page, I cannot "mentally" test your Statement/Script against an "imaginary" Page, ah-ah...!! :shock:

... But I would think you probably don't need the Single Quotes, unless they are present as well in the Source of your Page...

And again, I personally find 'TAG' + 'EXTRACT' much easier to use (and more powerful) than 'SEARCH'...

And depending on what for Action(s) you'll want to do after finding one of your Elements, if it is to click on some other Element/Button/Whatever, then even simpler is to simply use "Relative Positioning" (and play with '!ERRORIGNORE' and '!TIMEOUT_STEP')...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Sun Jan 15, 2017 2:20 pm

chivracq wrote:

Well, about your Statement, I don't know really, I don't use this 'SEARCH' Command myself as I find it "complicated" to use and I don't like (= I don't master...! :oops: ) 'REGEXP', check the Wiki for the correct Syntax and Examples, and you'll find maybe better Examples on the Forum as well..., I think (Advanced) User @iimfun has produced a few good Code Examples...
And then you test your Statement/Script against your Site/Page..., you didn't post the URL of your Site/Page, I cannot "mentally" test your Statement/Script against an "imaginary" Page, ah-ah...!! :shock:


unfortunately the website i'm trying to make this for requires a login :/ if viewing the source or screenshots might help I can do that.

chivracq wrote:

... But I would think you probably don't need the Single Quotes, unless they are present as well in the Source of your Page...

And again, I personally find 'TAG' + 'EXTRACT' much easier to use (and more powerful) than 'SEARCH'...

And depending on what for Action(s) you'll want to do after finding one of your Elements, if it is to click on some other Element/Button/Whatever, then even simpler is to simply use "Relative Positioning" (and play with '!ERRORIGNORE' and '!TIMEOUT_STEP')...


Great thanks so much -- I will have to read up on using Tag + Extract, and also '!ERRORIGNORE' and '!TIMEOUT_STEP'. because if I can automate it one step further there is another two buttons to press and the whole process can be automated without me being there.

I don't really know any programming languages.. I've taken some free online classes in python from udacity.com and corsera.org but that's about it! I appreciate you pointing me in the direction on what to look at, I'll try to read up on those things mentioned above and see if I can figure something out.


Do people make "outlines" for programming?? Here is in english what I want my script to do:

Step 1: push search button.
*browser loads a list of items, Items aren't always there, usually not more than 1 or 2 on the list and usually the list is empty*
Step 2: Tag/extract searches the page for any of the dates I specify (never more than 11 dates on the list)
If there is a match on a date: Push a button 500 or so px to the left and another button, and click yes on the popup that comes up.
If no match, repeat loop.
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by chivracq on Sun Jan 15, 2017 3:10 pm

inck243 wrote:unfortunately the website i'm trying to make this for requires a login :/ if viewing the source or screenshots might help I can do that.

Yeah, it always help a bit, at least to understand how the Page looks like, maybe better is a Full HTML Saveas of the Page, zipped, Max 256Kb, uploaded to the Thread..., then both Layout and Source are present and I can "play" with the Page...

But what you want to do doesn't sound very difficult and I won't be writing your Script, ah-ah...!
And hum, your Site sounds like it is for a Game and I'm not too keen on helping Users use/misuse iMacros for (cheating on) Games and Votes, ah-ah...!

inck243 wrote:Great thanks so much -- I will have to read up on using Tag + Extract, and also '!ERRORIGNORE' and '!TIMEOUT_STEP'. because if I can automate it one step further there is another two buttons to press and the whole process can be automated without me being there.

I don't really know any programming languages.. I've taken some free online classes in python from udacity.com and corsera.org but that's about it! I appreciate you pointing me in the direction on what to look at, I'll try to read up on those things mentioned above and see if I can figure something out.

Do people make "outlines" for programming?? Here is in english what I want my script to do:

Step 1: push search button.
*browser loads a list of items, Items aren't always there, usually not more than 1 or 2 on the list and usually the list is empty*
Step 2: Tag/extract searches the page for any of the dates I specify (never more than 11 dates on the list)
If there is a match on a date: Push a button 500 or so px to the left and another button, and click yes on the popup that comes up.
If no match, repeat loop.

iMacros and its Language is much-much easier to understand/learn than Python, you simply record your Actions and iMacros creates your Code... that you only slightly need to edit if you want to tune the '!TIMEOUT_xxx' Settings or add the Extract Mechanism or change a "POS=1" into "POS=R1" for "Relative Positioning" or add some 'WAIT' Statement...

And from the Behaviour/Scenario you describe, it sounds like a typical Usecase for "Relative Positioning"...
You use any Date HTML Element as the Anchor to then click on your Button if the Date HTML Element was found, and you repeat for each Date, unless you are able to "group" several Dates together using Wildcards (*)...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Sun Jan 15, 2017 3:38 pm

It's not for a game :) I'm just doing this to make my life easier !! lol
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Sun Jan 29, 2017 5:02 pm

chivracq wrote:




OK thanks!! I was able to make my macro but I can't figure out how to really get it working the way I need. Here is what I have:


Code: Select all
VERSION BUILD=9030808 RECORDER=FX


TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit

TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*


the POS 4 Tag button is not always there. So I need that line of code executed only if it is on the page. Otherwise, I want to restart the code from POS1. Is there a way to put conditions in?? I get this error when the POS=4 button is not on the page.

Code: Select all
element INPUT specified by * was not found, line: 3 (Error code: -921)



So here is an example what I need in Sudo code.


Code: Select all
VERSION BUILD=9030808 RECORDER=FX


1. TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit
2. if button POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=* is present:
3.    TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*
4. Else: repeat loop at line 1.



OR also this method would work -- which is easier?

Code: Select all
VERSION BUILD=9030808 RECORDER=FX


1. TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit
2. IF "there are no results to display" is on the page:
3.       repeat Loop
4. Else:
5.    TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*
 


When I "record" and highlight the text that says "there are no results to display"
it shows up like this in the macro:
Code: Select all
 
TAG POS=1 TYPE=DIV ATTR=TXT:There<SP>are<SP>no<SP>results<SP>to<SP>display


Is imacros able to make comparisons to this and what is actually on the browser in order to make a decision?

Thanks
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by chivracq on Sun Jan 29, 2017 5:51 pm

inck243 wrote:OK thanks!! I was able to make my macro but I can't figure out how to really get it working the way I need. Here is what I have:
Code: Select all
VERSION BUILD=9030808 RECORDER=FX

TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit

TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*

the POS 4 Tag button is not always there. So I need that line of code executed only if it is on the page. Otherwise, I want to restart the code from POS1. Is there a way to put conditions in?? I get this error when the POS=4 button is not on the page.
Code: Select all
element INPUT specified by * was not found, line: 3 (Error code: -921)

So here is an example what I need in Sudo code.
Code: Select all
VERSION BUILD=9030808 RECORDER=FX

1. TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit
2. if button POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=* is present:
3.    TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*
4. Else: repeat loop at line 1.

OR also this method would work -- which is easier?
Code: Select all
VERSION BUILD=9030808 RECORDER=FX

1. TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=NAME:btnSubmit
2. IF "there are no results to display" is on the page:
3.       repeat Loop
4. Else:
5.    TAG POS=4 TYPE=INPUT:BUTTON FORM=ACTION:/ETB/IntegratedETBBulletin/Search ATTR=*

Like I said in my 2nd Reply, using '!ERRORIGNORE' (and a short '!TIMEOUT_STEP') would be the easiest Solution, if the 2nd Button is found, it will be clicked, otherwise, that Statement won't do anything... (and you won't get the Error that it is not found...)

inck243 wrote:When I "record" and highlight the text that says "there are no results to display"
it shows up like this in the macro:
Code: Select all
TAG POS=1 TYPE=DIV ATTR=TXT:There<SP>are<SP>no<SP>results<SP>to<SP>display


Is imacros able to make comparisons to this and what is actually on the browser in order to make a decision?

Thanks

Yep, using 'TAG' + 'EXTRACT', you (try to) extract that Field and using a main '.js' Script or 'EVAL()' in pure '.iim' to spit out a "1"/"0" for example to reuse for some later "TAG POS=n" to achieve your Conditional Logic.
Have a look at the following Thread where I explained several Techniques in pure '.iim':
- Workarounds for Conditional Logic in Macro Code
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Sun Jan 29, 2017 10:55 pm

OK great thanks. The error ignore and timeout is exactly what i needed!!




Now, I need to know how to make one macro start another. I saw in the FAQ this question and I'm reading what was under that FAQ but not quite getting it. http://wiki.imacros.net/Combine-Macros.vbs For Example, I have three macros.

#Login.iim
#Setup_search.iim
#yrdy.iim

My Login macro will log me into the website. After logging in, I want the login macro to automatically start #Setup_search.iim

So the last line of code of the login macro should be to start the Setup_search.iim

Then after the Setup_search.iim performs, It should launch #yrdy.iim which should be a constant loop.

** So I don't understand, does this require Javascript? Can my .iim macro file have javascript in it??


Also -- How do I code the looping structure into #yrdy.iim? Right now I just type 99999 into the "repeat Macro" box and press on Play (loop) but can I code the looping structure directly into the macro?

Thanks
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by inck243 on Tue Feb 07, 2017 11:53 am

How can I make a macro repeat without using the "play loop" button?
inck243
 
Posts: 10
Joined: Sun Jan 15, 2017 11:42 am

Re: Can Imacros Search like CTRL + F and play an alert when

by iimfun on Thu Feb 09, 2017 1:29 am

You can find a solution for Chrome here. Just adapt it to your task.
iimfun
 
Posts: 239
Joined: Tue Jul 19, 2016 6:06 am


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

-->