1 votes

Automatically download files without extension with selenium

I can't download a file that doesn't have an extension with python and selenium.

I have tried the following:

 options.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.ms-excel");
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.oasis.opendocument.spreadsheet");
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain");
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv");
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/forced-download");
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "*/*");

I have tried them separately, and none of them have worked for me.

The browser is firefox.

I have tried with the excel mime-types because the file should have an xls extension, and the pop-up to save the file detects it as excel.

Thanks in advance.

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X