Acessing getAllDataRecords()

Hi, I am currently running the 1 month eval version, and am trying to
access the method getAllDataRecords() as:

RemoteScrapingSession remoteSession = new RemoteScrapingSession( "MySession" );
ArrayList ReportData = new ArrayList(23);
....
ReportData = remoteSession.getAllDataRecords();

When compiling this I get the error -

C:\Program Files\screen-scraper professional edition>javac TCPLRemoteScrapingSession.java
TCPLRemoteScrapingSession.java:23: cannot resolve symbol
symbol : method getNumDataRecords ()
location: class com.screenscraper.scraper.RemoteScrapingSession
numDataRecords = remoteSession.getNumDataRecords();

Can anyone out there help?

Thanks!

Mark V.

Acessing getAllDataRecords()

Oop! My apologies, Mark. I was mistaken. Both of those methods actually correspond to the DataSet class.

Let me take a shot at giving an example for you. I'll assume that within your scraping session you have an extractor pattern called "REPORTS" whose corresponding DataSet is being saved in a session variable (i.e., under the "Advanced" tab for the extractor pattern the "Automatically save the data set generated by this extractor pattern in a session variable" checkbox is checked). Your code would invoke screen-scraper remotely, and include this import statement:

import com.screenscraper.common.*;

You would then have code following the RemoteScrapingSession's 'scrape' method invocation that might look something like this:

DataSet reportsDataSet = ( DataSet )session.getVariable( "REPORTS" );

ArrayList reportsList = reportsDataSet.getAllDataRecords();

My apologies again for the confusion. Hopefully that clarifies things. Feel free to post back if I can clear up anything else.

Kind regards,

Todd

Example using getAllDataRecords using Java

Hi Todd,

Thanks for the feedback. Can you provide a small example in Java that uses getAllDataRecords? Which classes do I need to include?

Thanks,

Mark

Acessing getAllDataRecords()

Hi Mark,

Thanks for the posting. It looks like you may just be invoking the wrong method. In the code you initially give you include this line:


ReportData = remoteSession.getAllDataRecords();

But the error message indicates the following line as having the trouble:


numDataRecords = remoteSession.getNumDataRecords();

That is, I believe you need to change your code to something like the former rather than the latter, perhaps like so:


ArrayList reportData = remoteSession.getAllDataRecords();

The 'getNumDataRecods()' method corresponds to the DataSet class and not the RemoteScrapingSession class.

Hopefully this clarifies the issue. If not, please feel free to post a reply.

Kind regards,

Todd Wilson