Reputation:
I have a huge imacro script to run. I added a header to connect to a proxy using a list. I'm trying to do some error handling. I need to find a way to tell imacros if the current proxy is working or not. If it's working, then continue and execute the script. If it's not working, switch to the next loop so we can start over and try with another proxy.
Here's what i have so far:
SET !ERRORIGNORE YES
TAB T=1
CLEAR
SET !FILESTOPWATCH mydata.csv
STOPWATCH ID=total
SET !DATASOURCE C:\proxies.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !TIMEOUT 60
PROXY ADDRESS={{!COL1}} BYPASS=127.0.0.1
URL GOTO=http://www.mywebsite.com/test.php
The last line will connect to mywebsite.com and display the page test.php which is just a blank page with the word "working". If we can see the word "working" befiore the 60 seconds timeout, then we can continue with the rest of the script. But if we couldn't get the "working" word before 60 seconds, i need to exit current loop and switch to next, and this is what i can't figure out how to do
Upvotes: 0
Views: 983
Reputation: 5299
First of all try this script (for Firefox ‘iMacros’ estension!) and catch the idea:
var ret = iimPlayCode("URL GOTO=http://www.mywebsite.com/test.php");
if (ret == 1)
alert("Page is found!");
else
alert("Page is not found!");
Upvotes: 1