I see in the Selenium discussion groups, the following has been a frequent topic:
How to download file with Selenium/WebDriver?
particularly a cross-browser, cross-OS solution, or when FF/Chrome profile doesn’t work for the auto download file to some location (w/o prompting) and AutoIt, etc. not perfect.
The typical suggestion is to do it via external code via HTTP libraries for your language platform. But so far, there’s only suggestion of Java:
Being an idealist, I think it would be nice if there were more options besides Java. And furthermore, could provide more library code for integrated testing to do more than just download files. I’m thinking along the lines of sharing session cookies to make HTTP POSTs and other REST API calls outside of Selenium but that require a session that is started from and available with Selenium. Think functional GUI + API testing together.
On that note at least, here’s a start for similar example to the Java one in PHP:
Now who’s with me in trying to offer more to the community than just Java (and PHP)? We should have equivalent examples in .NET, Python, Ruby, etc.
Python version can be from this: https://github.com/cryzed/Selenium-Requests
and an alternate simple gist for Java: https://gist.github.com/daluu/4411221