Python+selenium File Download

Source: Internet
Author: User

1. Set some download parameters first:
#To set the parameters, the parameters can be viewed by entering about:config in the browser address bar.#Set to 0 for download to browser default download path, set to 2 to save to the specified directory Fp.set_preference ("Browser.download.folderList", 2)#Whether the display starts, (the individual experiment, whether set to True or false, does not show start, direct download) fp.set_preference ("browser.download.manager.showwhenstarting ",false) # download to the specified directory Fp.set_preference ( Span style= "COLOR: #800000" > "browser.download.dir", Span style= "COLOR: #800000" > "c:\\temp" " # Don't ask for the download path The following parameter is the value of the content-type of the page to download fp.set_preference ( " Browser.helperapps.neverask.savetodisk" application/octet-stream ")   


2, open the browser, enter the URL, click the Download button, as follows the code example

Python+selenium File Download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.