setVariable

void runnableScrapingSession.setVariable ( String identifier, Object value ) (professional and enterprise editions only)

Description

Set the value of a session variable.

Parameters

  • identifier Name of the variable, as a string.
  • value What to store in the variable: object, boolean, int, string, etc.

Return Values

Returns void.

Change Log

Version Description
4.5 Available for professional and enterprise editions.

Examples

Set Session Variable

 runnableScrapingSession = new com.screenscraper.scraper.RunnableScrapingSession( "My Session" );

 // Sets the session variable "LOGIN_USERNAME" with the value
 // "my_username".
 runnableScrapingSession.setVariable( "LOGIN_USERNAME", "my_username" );

 // Start the scrape
 runnableScrapingSession.scrape();

See Also

  • getVariable() [RunnableScrapingSession] - Retrieves the value of a session variable from the scraping session