microlink logo

Microlink Recipe for Retrieve HTML

retrieveHtml.js
const mql = require('@microlink/mql')

const retrieveHtml = async (url, opts) => {
  const { data } = await mql(url, {
    meta: false,
    data: {
      html: {
        selector: 'html',
      },
    },
    ...opts,
  })

  return data.html
}

const result = await retrieveHtml('https://example.com')
console.log(result)