pause
void sutil.pause ( long milliseconds ) (professional and enterprise editions only)
Description
Pause scraping session.
Parameters
- milliseconds Length of the pause, in milliseconds.
Return Values
Returns void.
Change Log
Version | Description |
---|---|
5.0 | Moved from session to sutil. |
4.5 | Available for professional and enterprise editions. |
Pausing the scraping session also pauses the execution of the scripts including the one that initiates the pause.
Examples
Pause Scrape on Server Overload
// It should be noted that a status code of 503 is not
// always a temporary overloading of a server.
// Check status code
if (scrapeableFile.statusCode() == 503)
{
// Pause Scraping for 5 seconds
sutil.pause( 5000 );
// Continue/Rescrape file
...
}
// always a temporary overloading of a server.
// Check status code
if (scrapeableFile.statusCode() == 503)
{
// Pause Scraping for 5 seconds
sutil.pause( 5000 );
// Continue/Rescrape file
...
}
scraper on 07/16/2010 at 4:55 pm
- Printer-friendly version
- Login or register to post comments