How to download CSV file in Selenium webdriver using python

236 views
Skip to first unread message

Sri Vidya Gara

unread,
Jan 7, 2014, 9:28:48 AM1/7/14
to seleniu...@googlegroups.com
HI, 

I am new to selenium web driver and using python

In my script i want to download a file,  After clicking on the download link it will display a dialog box  which asks to save or open a file which it should not. How can i download the csv directly with out clicking on the popup? or clicking on save option through the script?

Please go through the below attachment for clear details and help me for handling this.

``

David Lai

unread,
Jan 7, 2014, 11:55:04 AM1/7/14
to seleniu...@googlegroups.com
I found downloads are problematic.  If I can find the href property of the download link.  I'll usually just grab the cookies and create a liburl request for fetching the file outside of the browser.  If there is a serverside http only cookie, then you're out of luck and will need a dev to help you with a test hook.

I have heard of other people who have done downloads to a "downloads" folder and have created a test profile to not prompt, and have a simple service or script on the local machine to check that folder.  However this technique does not work with 3rd party grids if you're a Sauce or Browserstack user.
Reply all
Reply to author
Forward
0 new messages