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
On a website, a button will appear on the page. It won't always be there. How could I use iMacros to do this:
Refresh a page until it xan click a button. When it can, it would click the button as well as another one that would appear after it.
I think the easiest thing to do would be to:
1. Run the macro in a loop
2. Ignore errors (SET !ERRORIGNORE YES)
3. Try pressing the buttons
If the button isn't there, the macro will just continue to the next iteration.
Of course you could also use iMacros Scripting.
The syntax for iMacros doesn't seem too difficult to make the program. Could I make it click the button without entering the coordinates of where the mouse should click? I want to only enter the button name in HTML instead.
I couldn't record the macro while the button isn't there, right?
Well, there are 2 options:
1. You can try to catch the moment when the button is there and record it with iMacros, or view the source and put the button name (or id) into iMacros manually, or just try to use the text on the button:
Code: Select all
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:TEXT_ON_THE_BUTTON_GOES_HERE
Code: Select all
DS CMD=CLICK X=411 Y=434
Because I'm not familiar with the iMacros syntax, here's the general idea of what I want to do. Could you convert the code to something that would work in iMacros? Should be fairly simple and hopefully well-commented.
SET !ERRORIGNORE YES -- ignore errors
while true do -- loop the code
NavigateTo: WebsiteNameHere.com -- load/refresh the website
if (Button_Name_Here) == nil then return end -- if the button isn't there, *keep looping*
else LeftClick:Button_Name_Here -- clicks the button if it is there
LeftClick:Button_Number_Two -- clicks a button that appears after the 1st is clicked
break loop -- stop the loop from running agin
All you have to do is write the code on the scripting/programming language of your choice and call the following macro in the loop:
Code: Select all
SET !ERRORIGNORE YES TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:TEXT_ON_THE_BUTTON_GOES_HERE WAIT SECONDS 1 TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:TEXT_ON_THE_SECOND_BUTTON_GOES_HERE
To run the macro from your code have a look at these 2 wiki articles:
Basically these 2 commands (iimInit and iimPlay) are the only ones you'll need to run the macro from your code.
Not unless you add a URL GOTO statement. So I suggest you 1st go to that page and then run the macro.
"Click to Re-submit" without the quotes.
is the - throwing it off? can I use a wildcard? like "Click*" or something like that??
Could you please post your full macro or tell me where I can see that submit button?
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:Update ATTR=NAME:submit&&VALUE:Continue
I get the second page that has the "Click to Re-Enter" button on it that I need to click with the below HTML info.
<input type="button" value="Click to Re-Enter" onClick="history.go(-1)" id="button2" style="color: maroon; font-size: 10pt; font-weight: bold" name="button2"><br>
this is the HTML code for that button. when I try to use this in iMacros it doesnt work
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:"Click to Re-Enter"
with or without the quotes.
using the ID does work
TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:button2
But i need to catch the button by the text on it.
there is also another button that will randomly pop up on this page that I need to press IF it exists and this one is by TEXT as well and that one says "CLICK TO ACCEPT" and NOT click on the "Click to Re-Enter" button
I need something external to loop the script right?