Page manipulation snippets

Page manipulation snippets modify the current page directly, useful when something on the page (a popup, an overlay, an autoplaying video) is getting in the automation's way.

Hide page elements


Hide the first element matching a selector. Useful for popups or overlays that block elements you need to click:

document.querySelector('<SELECTOR>').style.display = 'none';

Hide every element matching a selector:

var els = document.querySelectorAll('<SELECTOR>');
for (var i = 0; i < els.length; i++) {
    els[i].style.display = 'none';
}