Closed imikemiller closed 5 years ago
This didnt work for me:
const {getMetadata} = require('page-metadata-parser'); const url = 'https://github.com/mozilla/page-metadata-parser'; const response = await fetch(url); const html = await response.text(); const doc = new JSDOM(html); const metadata = getMetadata(doc, url);
I need to pass doc.window.document to the getMetaData call. Working code is:
doc.window.document
getMetaData
const {getMetadata} = require('page-metadata-parser'); const url = 'https://github.com/mozilla/page-metadata-parser'; const response = await fetch(url); const html = await response.text(); const dom = new JSDOM(html); const metadata = getMetadata(dom.window.document, url); //changed this call
Thanks for pointing this out @imikemiller! You're right I had switched away from using jsdom for domino but didn't update the docs. Fixed now, let me know if you have any other issues with the library.
This didnt work for me:
I need to pass
doc.window.document
to thegetMetaData
call. Working code is: