taught
taught

Reputation: 23

ChromeDriver downloads blob

Whenever I try to download a simple CSV file from a specific website the ChromeDriver downloads a blob.

I tried to resolve this with the following ChromeOptions but it did not help:

"download.default_directory": "c:/test_downloads/"
"download.prompt_for_download": False
"download.directory_upgrade": True

How can I download a file directly to my hard drive using ChromeDriver?

Download list of chrome

Upvotes: 0

Views: 1466

Answers (1)

taught
taught

Reputation: 23

The following code snipped solved my issue:

from selenium.webdriver.chrome.options import Options

chromeOptions = Options()
chromeOptions.add_experimental_option("prefs", {
    "download.default_directory": r"d:\Downloads",
    "download.prompt_for_download": False,
    "download.directory_upgrade": True,
    "safebrowsing.enabled": True
})
webdriver = webdriver.Chrome(options=chromeOptions)

Upvotes: 1

Related Questions