scraping next link pages (navigation problem)

I am working on a project to scrape the data automatically.

I am scraping a website called "www.uspto.gov".

These are the two links:

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=0&f=S&l=50&d=PTXT&OS=%22social+networking%22&RS=%22social+networking%22&Query=%22social+networking%22&TD=6908&Srch1=%22social+networking%22&NextList2=Next+50+Hits

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=0&f=S&l=50&d=PTXT&OS=%22social+networking%22&RS=%22social+networking%22&Query=%22social+networking%22&TD=6908&Srch1=%22social+networking%22&NextList3=Next+50+Hits

Now we can see from these urls that there is no direct parameter for next page like "page = 2". Instead of that I need to take the whole url into variable and then somehow change the parameters which are called as NextList2 and NextList3.

I tried a lot of different codes but nothing worked out.

Can you help me by providing the solution to this problem?

See the attached scraping

See the attached scraping session for an example.

Thank you so much. Need one more help.

Thank you so much sir for showing me a path towards success of my project. Actually I am new to screen-scraper so I keep asking some stupid questions too.

Now in this iteration of pages, I want to scrape all the details of the patent for all pages. Is it possible that I can solve it in any easy way?

Patel, I've seen your

Patel,

I've seen your questions on StackOverflow also, and it seems that you might be missing some of the basics. Have you need through the tutorials? If you're interested in engaging my people to build it for you, email me and we can discuss the specs/costs.

Please help me by giving tips

Thank you so much for the help you have provided so far. Actually I am a student and I am learning screen-scraper. I just need tips from you so that I can achieve my goals of automatic scraping details from all patents with navigation.

I am done with the page navigation. Now there are thousands of patents for each keyword searched. And so there are multiple pages too. So I need to scrape the details of each patents with the working navigation. Can you give me simple tips to do so?

Pagination like this is not

Pagination like this is not uncommon. What I would do is extract the total results from:

Hits 51 through 100 out of 6908

And make a script to:
total = Integer.parseInt(dataRecord.get("TOTAL"));
perPage = 100
pages = total/perPage;
if (tota%perPage>0)
    pages++;

for (i=2; i<=pages; i++)
{
    param = "NextList" + String.valueOf(i);
    session.log("Scraping " + param);
    session.setv("NEXT_PARAM", param);
    session.scrapeFile("Next search results");
}