Disable chrome download multiple files confirmation

后端 未结 9 1430
太阳男子
太阳男子 2020-12-02 01:57

I developed a crawler with ruby watir-webdriver that downloads some files from a page. My problem is that when I click to download the second file, Chrome opens a bar in the

9条回答
  •  无人及你
    2020-12-02 02:23

    for new chrome (version 46 or newer) this options was changed now your hash must looks like this:

    prefs = {
        'profile' => {
            'default_content_settings' => {'multiple-automatic-downloads' => 1}, #for chrome version olde ~42
            'default_content_setting_values' => {'automatic_downloads' => 1}, #for chrome newer 46
        }
    }
    
    browser = Watir::Browser.new :chrome, options: {prefs: prefs, args: ['--test-type', '--disable-infobars'}
    

提交回复
热议问题