I want to add a delay after clicking a button to get some data. The script is run inside the browser console.
$(pages()) get's the pagination buttons.
let calls = [];
for (let i = 1; i <= callPagesCount; i++) {
$(pages()).find('a')[i].click()
setTimeout(() => {}, 200)
// Call the below, 200 ms later
callsNode().map((i, el) => {
calls.push({
call_condition: $(el).find('div > span').text().trim(),
date: $(el).find('div').text().trim().match(/\[(.+)\]/i),
})
})
}
callsNode().map...inside the curly braces of thesetTimeout. That way it will be executed after 200ms.