Skip to content

Instantly share code, notes, and snippets.

@troggy
Last active January 18, 2021 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troggy/4f8e8b1420822219ca9415cba10297bd to your computer and use it in GitHub Desktop.
Save troggy/4f8e8b1420822219ca9415cba10297bd to your computer and use it in GitHub Desktop.
Lamoda.ru — Выбрать все материалы неживотного происхождения (веганские)
const cruel = ['войлок', 'велюр', 'замша', 'кожа', 'натуральн', 'спилок', 'шерст', 'мех'];
const probablyCruel = (v) => cruel.find(e => v.startsWith(e));
const checkVegan = () => {
[...document.querySelectorAll('.multifilter_material input[type=checkbox]')]
.forEach(e => !probablyCruel(e.parentNode.innerText) && e.click());
document.querySelector('.multifilter__title').click();
};
checkVegan();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment