script needed for this?

So, if all I want to do is scrape each page of a search, do I need a script to do that or do I just need to create a scrapeable file for each page?

I'm not a programmer so some of this stuff is a bit over my head. Thanks for any info you can provide.

--sam

script needed for this?

OK, so I went through the tutorials and I've run into a snag. My script seems to loop through the first page 99 times instead of looping through each iteration. I'm sure I've bungled something, but what exactly I don't know...

I have two scripts that I modified from the tutorials or from snippets posted here on the boards... Here's my page looping script...

for&#40;i=1; i<=99; i++&#41;
&#123;
   runnableScrapingSession = new com.screenscraper.scraper.RunnableScrapingSession&#40; "DCI Database" &#41;;
   runnableScrapingSession.setVariable&#40;"PAGE", String.valueOf&#40;i&#41;&#41;;
   runnableScrapingSession.scrape&#40;&#41;;
&#125;

the variable "PAGE" has been added to the URL in the Scrapable File so that the URL looks like this...

http&#58;//webapp.wizards.com/ratings.aspx?Page=~#PAGE#~&BrandRatedSeasons=26&ratingseasonid=26&Demographic=1%7C1&action=Search

And then I added this modified script to generate a file...

FileWriter out = null;

try
&#123;
  session.log&#40; "Writing data to a file." &#41;;

  // Open up the file to be appended to.
  out = new FileWriter&#40; "Epic.txt", true &#41;;

  // Write out the data to the file.
  out.write&#40; dataRecord.get&#40; "Ranking" &#41; + "\t" &#41;;
  out.write&#40; dataRecord.get&#40; "Link" &#41; + "\t" &#41;;
  out.write&#40; dataRecord.get&#40; "Name" &#41; + "\t" &#41;;
  out.write&#40; dataRecord.get&#40; "Rating" &#41; + "\t" &#41;;
  out.write&#40; dataRecord.get&#40; "Location" &#41; &#41;;
  out.write&#40; "\n" &#41;;

  // Close up the file.
  out.close&#40;&#41;;
&#125;
catch&#40; Exception e &#41;
&#123;
  session.log&#40; "An error occurred while writing the data to a file&#58; " + e.getMessage&#40;&#41; &#41;;
&#125;

The file is generated just fine. However, it's the same page 1 results over and over. I'm sure my lack of understanding when it comes to scripts is to blame here. Any help is greatly appreciated.

--sam

script needed for this?

Thanks for the info. Just one last question. Does it make more sense to create a script if I have a lot of search pages to go through? I don't mind learning how to script if it will make my life easier in the long run... just wondering if it's worthwhile if I have like 99+ search pages to scrape.

If scripting is the most efficient way of doing things, I'm sure I'll have questions about that once I delve into it a bit. All I do now is SQL and a tiny bit of Excel macros.

My test at creating a scrapeable file were successful so I'm really excited about using this tool. Nice job, Developers! :)

--sam