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

216
Visualizações
How to immediately invoke driver.quit() in Selenium?

Whenever I call driver.quit() it waits for the website to first complete loading then it closes the browser, is there any way I can force close the browser immediately?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When you invoke get() for an url using Selenium a lot many actions happens under the hood, including HTTP requests received by geckodriver, packets sent to and from the remote protocol in Firefox, and responses sent back to your client.

Once the basic mandatory requests/responses are successfully completed, based on the pageLoadStrategy the browser i.e. the client sends back the program control to Selenium to perform the next line of code.

Now pageLoadStrategy can be either of the following:

  • normail: This stategy causes Selenium to wait for the full page loading (html content and subresources downloaded and parsed).
  • eager: This stategy causes Selenium to wait for the DOMContentLoaded event (html content downloaded and parsed only).
  • none: This strategy causes Selenium to return immediately after the initial page content is fully received (html content downloaded).

So once the program control is returned back to Selenium based on pageLoadStrategy which is somewhat timebound, then only driver.quit() can be performed.

about 4 years ago · Juan Pablo Isaza 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