2 ms·
Try this: shot-scraper -h 800 'https://www.spiegel.de/international/' \ --wait-for "() => { const div = document.querySelector('[id^="sp_mess
by simonw 3y ago
Try this:
shot-scraper -h 800 'https://www.spiegel.de/international/' \
--wait-for "() => {
const div = document.querySelector('[id^="sp_message_container"]');
if (div) {
div.remove();
return true;
}
}"
shot-scraper runs that --wait-for script until it returns true. In this case we're waiting for the cookie consent overlay div to show up and then removing it before we take the screenshot.
Screenshots here: https://gist.github.com/simonw/de75355c39025f9a64548aa3366b16d7?permalink_comment_id=5000526#gistcomment-5000526 https://gist.github.com/simonw/de75355c39025f9a64548aa3366b1...