How to disable 'This type of file can harm your computer' pop up

后端 未结 8 1665
时光取名叫无心
时光取名叫无心 2020-11-27 20:43

I\'m using selenium chromedriver for automating web application. In my application, I need to download xml files. But when I download xml file, I get \'This type of file can

8条回答
  •  暖寄归人
    2020-11-27 21:20

    The only workaround that works for me:

    Use argument with path to chrome profile

    chromeOptions.add_argument(chrome_profile_path)
    

    Search for file download_file_types.pb in chrome profile folder. In my case ..chromedriver\my_profile\FileTypePolicies\36\download_file_types.pb

    Backup this file and then open with any hexeditor (you can use oline).

    Search for the filetype you want to download, i.e. xml and change it to anything i.e. xxx

提交回复
热议问题