Код:
const butts = Array.prototype.filter.call(
document.querySelectorAll('div[id^="start-ads-"] + div[id^="ads_id_"]'),
div => /Таймер:\s*10\s*секунд\s*$/.test(div.textContent)
).map(e => e.previousElementSibling.querySelector('span[onclick]'));
Ошибка:
C:\Users\User\Desktop\Test\aviso.js:24
document.querySelectorAll('div[id^="start-ads-"] + div[id^="ads_id_"]'),
^
ReferenceError: document is not defined
at getPic (C:\Users\User\Desktop\Test\aviso.js:24:5)
Использую node.js, puppeteer.js и atom. dom.js установлен.