a script to auto-increment int value after every scrape?

Hi,

This might be more of a Java question than screen-scraping. I was wondering is it possible to have a script in Java that can provide an auto-increment value to each row of scraped data? I am scraping product information and just need a simple product#1 has a "1", product#2 has a "2" as a product_id.

Thank you very much for any suggestions in advance!

I set a session variable

I set a session variable named COUNTER as 0, then each time I write use session.addToVariable("COUNTER", 1);