Skip to content

Instantly share code, notes, and snippets.

@danepowell
Last active May 25, 2021 14:33
Show Gist options
  • Save danepowell/7f60e15aa9ec4befd30702768b953562 to your computer and use it in GitHub Desktop.
Save danepowell/7f60e15aa9ec4befd30702768b953562 to your computer and use it in GitHub Desktop.
UCSF conversa covid screening bot
function waitForElementToDisplay(selector) {
var startTimeInMs = Date.now();
(function loopSearch() {
if (document.querySelector(selector) != null) {
document.querySelector(selector).click();
return;
}
else {
setTimeout(function () {
if (Date.now() - startTimeInMs > 60000)
return;
loopSearch();
}, 500);
}
})();
}
waitForElementToDisplay("div[block_id='118769'] div[class='Text']");
waitForElementToDisplay("div[option_value='37051']");
waitForElementToDisplay("div[option_value='37059']");
waitForElementToDisplay("div[option_value='37031']");
waitForElementToDisplay("div[option_value='37033']");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment