79348802

Date: 2025-01-11 20:08:39
Score: 0.5
Natty:
Report link

The previous answer by @supputuri works, however I needed to make a little modification which took hours to figure out. Here is the script that worked for me in case anyone else can't figure it out:

# navigate to chrome downloads page first
driver.get("chrome://downloads/")
driver.execute_script("document.querySelector('downloads-manager').shadowRoot.querySelector('#downloadsList downloads-item').shadowRoot.querySelector(\"button[id='cancel']\").click()")

The main changed part is button[id='cancel']

Reasons:
  • Blacklisted phrase (0.5): I need
  • Whitelisted phrase (-1): worked for me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @supputuri
  • Low reputation (1):
Posted by: Hannan Javed