python – Use Selenium WebDriver to cancel a download in progress
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?
Read more here: Source link
