Sorry for cross-posting, here is my question:
I need to automate downloading multiple zip files from a web page. The page is inside a site that I need to log in to (HTTPS enabled).
The web page contains many direct links to zip files.
Of course, I managed to login successfully and reach the web page, I have also detected all the anchors (a) elements with the absolute URLs (hrefs).
I am performing a click() method call against an anchor element, looks like the download is started succesfully. Over 200MB of data is downloaded but it is not saved anywhere.
PhantomJS.exe process is growing in memory consumption, so it's clearly keeping the downloaded data into its private memory space, but it never drops the data on the disk (a normal behavior I suspect).
So, the question is, how can I save the downloaded data to the disk? Or even better, how can I instruct phantomjs to automatically detect a download and save the data on a predefined location on the disk?
I am using it in conjunction with Selenium WebDriver .NET.
Also posted here: https://groups.google.com/forum/#!topic/phantomjs/dJZPyJ0riPY
Edit based on Artjom B.'s comment:
I do create my webdriver object like this:
protected override RemoteWebDriver CreateRemoteWebDriver() {
//return new FirefoxDriver();
PhantomJSDriverService s = PhantomJSDriverService.CreateDefaultService();
s.LocalStoragePath = @"g:\downloads\data";
s.DiskCache = true;
s.LogFile = @"g:\downloads\data\phantom.log";
s.LoadImages = false;
s.IgnoreSslErrors = true;
return new PhantomJSDriver(s);
}
Unfortunately, no data other than the log file is created..