Click or drag to resize

WebScraperDownloadFile Method (String, String, Boolean, HttpIdentity)

Requests a file to be downloaded from the given Url to the local file-system. Often used for scraping documents, assets and images.

Normally called with an Parse Method of IronWebScraper.WebScraper

Namespace:  IronWebScraper
Assembly:  IronWebScraper (in IronWebScraper.dll) Version: (
public virtual string DownloadFile(
	string url,
	string path,
	bool overWrite = false,
	HttpIdentity identity = null


Type: SystemString
The absolute url of the resource to be downloaded.
Type: SystemString
The path to which the downloaded file should be saved. You may give a directory name or a file name.

Relative paths will be resolved relative to WorkingDirectory.

overWrite (Optional)
Type: SystemBoolean
If set to true any existing file at the given path will be overwritten. If set to false a unique name such as "file(1).html" will be created in the case of a naming conflict.
identity (Optional)
Type: IronWebScraperHttpIdentity
An HttpIdentity to send the Request. If null, the ChooseIdentityForRequest method will be used to find a suitable identity.

Return Value

Type: String
The file path (relative to WorkingDirecory) which the file will be saved to.
See Also