NavigationUser loginscreen-scraper.com welcomes...
Currently online
There are currently 0 users and 3 guests online.
|
Tutorial 1: Page 8: Writing a Simple Script in Interpreted Java
screen-scraper uses the BeanShell library to allow for scripting in Java. If you've done some programming in C or JavaScript you'll probably find BeanShell's syntax familiar. Let's get right to it. Copy and paste the following text into the box labeled "Script Text": // Output a message to the log so we know that we'll be writing the text out to a file.Hopefully it's obvious what's going on, based on the comments in the script. We simply create an object used to write out the text (a "FileWriter"), write it out, then close up the file. Note the session.getVariable( "FORM_SUBMITTED_TEXT" ) method call, which retrieves the value of the "FORM_SUBMITTED_TEXT" session variable. This method call is able to get the value because we indicated earlier that the value for the "FORM_SUBMITTED_TEXT" token was to be saved in a session variable (i.e., when we checked the "Save in session variable?" box). If you haven't done much programming, this is where things might seem a little confusing. If so, you may consider trying a basic tutorial on Java or JavaScript, which will hopefully introduce you to the basics of programming. You'll especially want to get an introduction to object-oriented programming.
|
SearchNew Video!Tags Throughout this Site |
Recent comments
6 hours 9 min ago
6 hours 17 min ago
8 hours 23 min ago
1 day 3 hours ago
1 day 4 hours ago
1 day 4 hours ago
1 day 5 hours ago
1 day 5 hours ago
1 day 5 hours ago
3 days 2 hours ago