Setting selenium to use custom profile, but it keeps opening with default

后端 未结 3 1983
悲哀的现实
悲哀的现实 2020-12-01 06:20

I am trying to use python and selenium to automate some tasks in firefox. When I download a file, that pop up comes up asking if you want to open or save, and a check box fo

3条回答
  •  無奈伤痛
    2020-12-01 07:12

    You should add this:

    profile.set_preference("browser.helperApps.neverAsk.openFile",
        "text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml")
    

    It does work!

提交回复
热议问题