tomav / node-microdata-scraper

Scrape & parse a webpage to return a JSON with found microdata (schema.org)
MIT License
44 stars 9 forks source link

TypeError: Cannot read property 'constructor' of null #7

Open daanjanssen1998 opened 7 years ago

daanjanssen1998 commented 7 years ago

I have problems scraping this url (https://www.conrad.nl/nl/led-tv-49-inch-samsung-ue49ku6509-zilver-1426083.html).

I got the following error:

/home/daan/microdata/node_modules/MD5/md5.js:9
    if (message.constructor == String)
               ^

TypeError: Cannot read property 'constructor' of null
    at md5 (/home/daan/microdata/node_modules/MD5/md5.js:9:16)
    at module.exports (/home/daan/microdata/node_modules/MD5/md5.js:154:42)
    at processTag (/home/daan/microdata/node_modules/node-microdata-scraper/index.js:44:38)
    at Object.<anonymous> (/home/daan/microdata/node_modules/node-microdata-scraper/index.js:69:7)
    at /home/daan/microdata/node_modules/node-microdata-scraper/node_modules/cheerio/lib/api/traversing.js:232:18
    at /home/daan/microdata/node_modules/underscore/underscore.js:120:25
    at _.each._.forEach (/home/daan/microdata/node_modules/underscore/underscore.js:82:22)
    at Function._.reduce._.foldl._.inject (/home/daan/microdata/node_modules/underscore/underscore.js:115:5)
    at module.exports.exports.map (/home/daan/microdata/node_modules/node-microdata-scraper/node_modules/cheerio/lib/api/traversing.js:231:23)
    at parse (/home/daan/microdata/node_modules/node-microdata-scraper/index.js:61:40)

This is my code:

var url = 'https://www.conrad.nl/nl/led-tv-49-inch-samsung-ue49ku6509-zilver-1426083.html';
microdata.parseUrl(url, function(err, json) {
    if (!err && json) {
        console.log(json);
    }
});

I already have tried it to fix with installing the md5 package from npm with npm install md5.

I am using the following versions:

javidjamae commented 7 years ago

I have the same exact issue when trying to parse this url: https://www.eventbrite.com/e/startup-weekend-oakland-0917-tickets-37018869435?aff=ehomecard