Dont allow puppeteer to fail if empty tag is found

This commit is contained in:
Jackson Harper
2023-01-03 12:42:06 +08:00
parent 742ff7aa69
commit dc444a471d

View File

@ -590,7 +590,7 @@ async function retrieveHtml(page, logRecord) {
try { try {
// Removing blurred images since they are mostly the copies of lazy loaded ones // Removing blurred images since they are mostly the copies of lazy loaded ones
if (['img', 'image'].includes(el.tagName.toLowerCase())) { if (el.tagName && ['img', 'image'].includes(el.tagName.toLowerCase())) {
const filter = style.getPropertyValue('filter'); const filter = style.getPropertyValue('filter');
if (filter && filter.startsWith('blur')) { if (filter && filter.startsWith('blur')) {
el.parentNode && el.parentNode.removeChild(el); el.parentNode && el.parentNode.removeChild(el);