Tools to Capture and Convert the Web

Perform an action only once during a scrape

Sometimes when performing a scrape you need to perform an action once during the whole scrape such as login or carry out a search, with GrabzIt's Web Scraper this is easy. First of all create a new scrape with the normal details such as the starting page of the scrape and any other options.

Then go to the Scrape Instructions and enter the text below.

if (Global.get("myaction") != "done")
{
    Global.set("myaction", "done");
    //Put the action you only want to do once here
}

The above code uses a global variable called myaction to check if the action has been executed. If the global variable has not been set to done the action within the if statement is executed and the myaction variable is set so it is not executed again.

Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Captures
  • Bigger Everything
Start Free Trial