Skip to content

Instantly share code, notes, and snippets.

@Inndy
Created February 20, 2024 08:12
Show Gist options
  • Save Inndy/800bef2180c841403497f354fd0d900a to your computer and use it in GitHub Desktop.
Save Inndy/800bef2180c841403497f354fd0d900a to your computer and use it in GitHub Desktop.
function searchTag(el, tag) {
return el.tagName === tag ? el : searchTag(el.parentNode, tag);
}
const blockList = /acer|kioxia|pny/ig
const requireList = /[124]tb/ig
[...$$('#ItemContainer .prod_name')]
.filter(el => el.textContent.match(blockList) || !el.textContent.match(requireList))
.map(el => searchTag(el, 'DL'))
.forEach(el => el.remove())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment