Last active
March 4, 2020 20:18
-
-
Save danielyaa5/98fa2ea03aa1920e4c7e2998738348b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const delay = (ms) => { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
const getExpandButtons = () => { | |
return Array.from(document.querySelectorAll("[title='Expand Down']")).concat(Array.from(document.querySelectorAll("[title='Expand All']"))) | |
} | |
const expandAll = async () => { | |
let expand_buttons = getExpandButtons(); | |
while (expand_buttons.length) { | |
for (let i = 0; i < expand_buttons.length; i++) { | |
expand_buttons[i].click() | |
await delay(50) | |
} | |
expand_buttons = getExpandButtons(); | |
} | |
} | |
expandAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment