Bird
0
0

Which is the correct way to set the Firefox profile preference in Selenium Python to disable the download dialog for CSV files?

easy📝 Syntax Q3 of 15
Selenium Python - Advanced Patterns
Which is the correct way to set the Firefox profile preference in Selenium Python to disable the download dialog for CSV files?
Aprofile.set_preference('browser.download.manager.showWhenStarting', 'text/csv')
Bprofile.set_preference('browser.download.folderList', 'text/csv')
Cprofile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/csv')
Dprofile.set_preference('browser.download.dir', 'text/csv')
Step-by-Step Solution
Solution:
  1. Step 1: Identify the preference to disable download prompt

    The preference 'browser.helperApps.neverAsk.saveToDisk' specifies MIME types to save without prompt.
  2. Step 2: Set the MIME type for CSV files

    Use 'text/csv' as the MIME type for CSV files.
  3. Final Answer:

    profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/csv') -> Option C
  4. Quick Check:

    Correct preference for auto-download without prompt [OK]
Quick Trick: Use 'browser.helperApps.neverAsk.saveToDisk' for MIME types [OK]
Common Mistakes:
  • Confusing folderList with MIME type setting
  • Using incorrect preference keys
  • Passing MIME type to folderList or download.dir

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes