Exclude the root scope for cheerio: there are websites with problematic <head> tag or without one

This commit is contained in:
Anton Gunov
2017-11-22 15:26:40 +07:00
parent 53c4806c25
commit b3ba1655d2
3 changed files with 23 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ module.exports = ($) => {
const icons = [];
selectors.forEach((selector) => {
$(selector, 'head').each((i, elem) => {
$(selector).each((i, elem) => {
const { href, sizes, type } = elem.attribs;
if (href !== '#') {
const icon = {