Download File Through Google Chrome in Headless Mode

Download file through RemoteWebDriver and chrome in headless mode

Solution:

Just make sharefolder on machine where running selenium node or where have access to and set properties for downloadpath on network path

String downloadFilepath = "\\localhost\folderfordownload";
​chromePrefs.put("download.default_directory", downloadFilepath);

How to fix chrome headless not downloading files?

First, see this bug thread.

As of 4 days ago... what you need is to add the size of the headless...

if headless==True:
chrome_options.add_argument('--headless')
chrome_options.add_argument('--window-size=1920,1080')

As per the error:

unknown error: DevToolsActivePort file doesn't exist

You can add --disable-dev-shm-usage as an argument:

 chrome_options.add_argument('--disable-dev-shm-usage')

See @DebanjanB answer.

Hope this helps you!



Related Topics



Leave a reply



Submit