microlink logo

Microlink Recipe

Interact with coolmod.com

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

const coolmod = async (url, opts) => {
  const result = await mql(url, {
    data: {
      price: {
        selector: '.container-price-total',
        attr: 'text',
      },
      image: {
        selector: '#_image2',
        attr: 'src',
        type: 'url',
      },
    },
    ...opts,
  })

  result.data.price = result.data.price.trim()

  return result
}

const result = await coolmod(
  'https://www.coolmod.com/msi-mag-b550-tomahawk-socket-am4-placa-base-precio'
)
console.log(result)