Can't retrieve session variables from JavaScript scripts
Hi,
I'm pretty new to screen scraper, so I'm sure there's probably a simple explanation, but I'm having trouble retrieving session variables when I create JavaScript scripts. For example, if I create a new script with just the following;
session.setVariable( "Foo", "Bar" );
session.log( session.getVariable("Foo") );
It works fine under interpreted java, but as soon as I try switching it to JavaScript, I get the following error in the session log;
ERROR--PB Scraping Session: An error occurred while processing the script: PB_CreatePostVariables
PB Scraping Session: The error message was: JavaScript Error: Internal Error: java.lang.ArrayIndexOutOfBoundsException: 19567
Can someone please tell me what I'm doing wrong?
Thanks,
Dan
I generally urge people to
I generally urge people to use Interpreted Java because we use it internally for everything and test it rigorously. JavaScript is through another library, and there is a link to their documentation here.
Hi, Any help with accessing
Hi,
Any help with accessing the system datarecord object from within a screen-scraper javascript script would be much appreciated?
Ta,
Dan
Thanks, but unfortunately,
Thanks, but unfortunately, I'm trying to mimic some processing done in existing javascripts, so it's a lot more straightforward for me to just cut and paste the functions into screen-scraper scripts.
The page you linked to showed me how to create a new datarecord object, but how do I access the existing datarecord object that has the variables set in extractor patterns within it?
None of the people internally
None of the people internally ever really use JS in screen-scraper. Did you look at the Rhino documentation?