getStatusCode

int scrapeableFile.getStatusCode ( ) (professional and enterprise editions only)

Description

Determine the HTTP status code sent by the server.

Parameters

This method does not receive any parameters.

Return Values

Returns integer corresponding to the HTTP status code of the response.

Change Log

Version Description
4.5 Available for professional and enterprise editions.

Examples

Write warning to log on 404 error

 // Check for a 404 response (file not found).
 if( scrapeableFile.getStatusCode() == 404 )
 {
     url = scrapeablefile.getCurrentURL();
     session.log( "Warning! The server returned a 404 response for the url ( " + url + ")." );
 }