microlink logo

Microlink Recipe

Retrieve all the HTML markup of the target URL

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

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

  return data.html
}

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