LuisOjeda wrote: ↑Sun Nov 21, 2021 9:05 pmWindows 10, version 21H2 (Spanish)
Chrome 96.0.4664.45 (64 bit)
iMacros for Chrome, Personal Edition
¡Good evening, everyone!
First of all, I would like to apologise in advance if I use the incorrect terminology. I am very new to iMacros and I am still learning.
I have been reading several posts and trying different methods, but unfortunately I don't manage to write the macro that I want.
My goal: I want to refresh a page until a link appears. Once the link appears, I want to click on it and then click on another button ("Accept") that appears on a second page. I have deleted sensitive information, since I can't publish it online. So far, the macro that I have created is the following one:
1. I have included "WAIT SECONDS" after the clicks to allow some time for the page to reload. Not sure, however, if I really need it. Maybe iMacros waits until the website is loaded and moves to the next step (that would save me 0.6 seconds).Code: Select all
VERSION BUILD=1011 RECORDER=CR WAIT SECONDS=0 SET !TIMEOUT_STEP 0 SET !ERRORIGNORE YES URL GOTO=https://name-of-the-website. REFRESH WAIT SECONDS=0.3 TAG POS=1 TYPE=DIV ATTR=TXT:Click<SP>Here WAIT SECONDS=0.3 TAG POS=1 TYPE=BUTTON ATTR=TXT:Accept
2. At the moment, iMacros works but runs the entire script, even when the button with the text "Click Here" doesn't appear.
3. I would like to know if there is any way in which iMacros refreshes the website until the button "Click Here" appears and then follows the rest of the script.
Thank you in advance for any help you can provide. I apologise once again if I have used the wrong terminology or if I didn't express myself correctly.
Have a great evening!
=> FCI:
Code: Select all
iMacros v10.1.1 for CR, 'PE', CR96_x64, Win10_x64 v21H2 (SP).
Then, well, your Script looks just fine to me, this is "the Way" to use iMacros indeed...
... Except for the `URL GOTO` + `REFRESH` Commands next to each other, they both do the same Action, so this is "Double" and you are loading the Page twice before the Script will start looking for the "Click Here" 'DIV' (or Link), => only keep the `URL GOTO` Command I would say, it is more "reliable" than `REFRESH`...
If you further want to "tune" your Script for Speed, you can indeed try shortening the x2 `WAIT` Statements, + also shortening the `!TIMEOUT_PAGE` Setting (Default = 60 Sec currently), with the "Risk" that "sometimes" maybe, the Page will not load correctly/completely, but it depends on the Site and on your Internet Connection/Speed to find the "right Balance" between Reliability and Speed...
What also helps to load a Page/Site as quick as possible, => is to use some Ad-Blocker Extension and to try to block any "external"/2nd or 3rd Party Scripts like 'FB'/'Instagram'/'LinkedIn'/'Google Adsense'/etc... Plugins on the Page, or even Images, ... without "breaking" some Functionality from the Site...