downloadFile
session.downloadFile( String url, String fileName ) (professional and enterprise editions only) session.downloadFile( String url, String fileName, int maxNumAttempts ) (professional and enterprise editions only) session.downloadFile( String url, String fileName, int maxNumAttempts, boolean doLazy ) (enterprise edition only) |
| Description |
| Downloads the file found at the url and saves it to a local file system at the path designated by fileName. If the second version of the method is called, you can designate a maximum number of attempts, in the event that a single attempt fails. The third method allows for the file to be downloaded in a separate thread. If "true" is passed as the value for the third parameter the method call will return immediately, and the file will be downloaded while the scraping session continues on. This method also returns a boolean to indicate the success of the download. |
 |
| Example |
// Downloads the image pointed to by the URL to the local C: drive. // A maximum number of 5 attempts will be made to download the file, // and the file will be downloaded in its own thread. session.downloadFile( "http://www.foo.com/imgs/puppy_image.gif", "C:/images/puppy.gif", 5, true ); |
|
|