1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Use Selenium WebDriver to cancel a download in progress

Discussão em 'Python' iniciado por Stack, Setembro 16, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to write python code to cancel a download in progress using selenium. I previously used the code supplied here to do this but these days (chrome Version 128.0.6613.138) the cancel button is hidden inside a dropdown menu.

    I can display the dropdown menu easily enough:

    w.driver.execute_script("document.querySelector('downloads-manager').shadowRoot." +"querySelector('#downloadsList downloads-item').shadowRoot.querySelector('#more-actions').click()")

    Image of dropdown list in chrome downloads

    But the task of identifying and clicking on an item within the dropdown list has stumped me completely. Can anybody help please?

    Continue reading...

Compartilhe esta Página