How to programmatically Download a file from Google Drive, using Javascript and HTML? (NOT Google Drive API)

P.S: I do NOT want to use the GoogleDriveAPI.

Steps:

1. Select file

2. Download file, using one of the following options:

What's working:

Select the file using:

document.querySelector('div[jsname=LvFR7c]').click() 

Expand the file options menu using:

document.getElementsByClassName("pc7nUb I5YcP Dk9rmd").click() 

What's NOT working:

Clicking Download button from page or from file options menu

Conclusion:

I noticed that the Google Drive HTML elements are mostly with aria roles like button, menu, & menuitem. Some of these elements have a jsaction attribute. When these elements are clicked via code, some of them behave as they do when clicking with the mouse, and others do nothing when clicked via code. So I'm just confused and am not sure what to try next.

I feel like this is a trivial task, but this is my first time working in Javascript & HTML, so I'm sure I might be missing something simple.

Would really appreciate any help. Thanks!

Download Button HTML Elements:

Page Download button HTML:

document.querySelector('div[aria-label=Download]') 

File Options Menu Download button HTML:

document.querySelectorAll('div[aria-label=Download]')[3] 

Things I've tried on the above Download Button HTML Elements:

element.click() element.dispatchEvent(new Event('click')) element.dispatchEvent(new Event('keydown')) // (with more options in the Event initializer) element.dispatchEvent(new Event('keyup')) element.focus() element.setAttribute('aria-expanded', true) element.setAttribute('aria-pressed', true) element.ariaPressed = true