Last active
June 3, 2021 01:20
-
-
Save niall-byrne/8909729b20c8b4c20066838abe300bb9 to your computer and use it in GitHub Desktop.
Globe and Mail Automation
This file contains hidden or 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
var input = document.getElementsByClassName('bc-add-symbol-input')[0] | |
var button = document.getElementsByClassName('bc-button-gray')[0] | |
var values = "SYMBOL1 SYMBOL2".split(" "); | |
var event_enter = new KeyboardEvent("keydown", { | |
bubbles: true, cancelable: true, keyCode: 13 | |
}); | |
var event_input = new Event('input', { | |
bubbles: true, | |
cancelable: true, | |
}); | |
values.forEach((item, index) => { | |
setTimeout(function () { | |
input.value = item; | |
input.dispatchEvent(event_input); | |
input.dispatchEvent(event_enter); | |
}, index * 500); | |
}); |
This file contains hidden or 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
Automation for the Globe and Mail website. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment