Next page ++

I'm using the example script of the "memory conscious next page". For some reason the OFFSET variable does not increase from its initial value and the page sequence never get going. To my knowledge I have not changed anything that should interfere with the logic in the below example. The variable NEXT_URL is saved to session variable and have "positive" values. I am calling the script "after each application pattern" on the Search result page and the following Next search result page. Is there something missing in the example script or am I missing something?

// If using an offset, this number should be the first search results page's offset, be it 0 or 1.
int initialOffset = 0;

// ... and this number is the amount that the offset increases by each
// time you push the "next page" link on the search results.
int offsetStep = 50;

String fileToScrape = "Next search results";

/* Generally no need to edit below here */

hasNextPage = "true"; // dummy value to allow the first page to be scraped
for (int currentPage = 1; hasNextPage != null; currentPage++)

{
// Clear this out, so the next page can find its own value for this variable.
session.setVariable("NEXT_URL", null);
session.setVariable("PAGE", currentPage);
session.setVariable("OFFSET", (currentPage -1) * offsetStep + initialOffset);
session.scrapeFile(fileToScrape);
hasNextPage = session.getVariable("NEXT_URL");
}

Happy for hints,

Johan

No need to reply on this one.

No need to reply on this one. I restarted SS and the it started to count. Still a mystery why, but its working.