Stopping a Macro

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
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
BillHamaker
Posts: 13
Joined: Fri Jul 12, 2013 4:54 pm

Stopping a Macro

Post by BillHamaker » Fri Jul 12, 2013 5:14 pm

I'm just beginning using iMacros and am confused on how to stop a failed macro. I hope someone can help me figure this out.

I have successfully written some test macros to extract data using scripting with excel VBA. Basically I have a spreadsheet containing the lookup identifiers needed on the web page and the script passes them to the extraction macro and puts the results into the spreadsheet.

Everything works find except occasionally the web site can't find a record matching the identifier I provide and displays some sort of error screen or maybe a pop up. In that case the subsequent TAG commands fails since the error screen doesn't have the matching information. I can detect the failure in the script and everything does function okay but if I have a lot of TAG commands the program is waiting 6 seconds for each TAG command which of course slows things way down if there a lot of failures.

What I really want to happen is for the Macro to stop running and return the failure to the VBA script as soon as the first TAG command fails but I can't find any way to do that. What is the secret???
janib4all
Posts: 132
Joined: Wed Jul 21, 2010 6:44 am
Location: Karachi, Sindh, Pakistan
Contact:

Re: Stopping a Macro

Post by janib4all » Mon Jul 22, 2013 8:22 am

You can use 2 approaches to deal with this kind of condition:

1) Use 'Set ErrorIgnore Yes'
2) Scrap supporting data for checking

i.e.,)
Get some data from page
Check if data contains "some_value"
if yes
{
good
} else {
not good
}

Likewise, I use to check word 'Captcha' every time before performing a desired action for a site, in case this word was found, I was able to bypass by script to performing matching action.

Hope it helps.
Hire the BoT-fReeak!
botspecialist.blogspot.com
Post Reply