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. |
 |
| 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 ); |
|
|
Recent comments
1 day 16 hours ago
1 day 16 hours ago
1 day 17 hours ago
4 days 17 hours ago
4 days 17 hours ago
4 days 23 hours ago
5 days 16 hours ago
5 days 17 hours ago
5 days 21 hours ago
6 days 18 hours ago