Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.3K
Visualizações
TypeError: WebDriver.__init__() got an unexpected keyword argument 'firefox_options' error using firefox_options as arguments in Selenium Python

I'm trying to create a script which downloads a file from a website and for this I want to change the download filepath. When I try to do this with the Firefox options it gives me this error:

TypeError: WebDriver.__init__() got an unexpected keyword argument 'firefox_options'

Code:

from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.keys import Keys
import time

options = Options()

options.add_argument("download.default_directory=C:\\Music")
browser = webdriver.Firefox(firefox_options=options, executable_path=r'C:\\selenium\\geckodriver.exe')
browser.get('https://duckduckgo.com/')
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The browser option parameter firefox_options was deprecated in Selenium 3.8.0

  • Browser option parameters are now standardized across drivers as options. firefox_options, chrome_options, and ie_options are now deprecated

Instead you have to use options as follows:

from selenium.webdriver.firefox.options import Options

options = Options()
options.add_argument("download.default_directory=C:\\Music")
browser = webdriver.Firefox(options=options, executable_path=r'C:\\selenium\\geckodriver.exe')
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda