microlink logo

Microlink Recipe for PcComponentes

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

const pccomponentes = (url, opts) =>
  mql(url, {
    data: {
      price: {
        selector: '#precio-main',
        attr: 'data-price',
        type: 'number',
      },
      image: {
        selector: '.pc-com-zoom.img-fluid',
        attr: 'src',
        type: 'url',
      },
    },
    ...opts,
  })

const result = await pccomponentes(
  'https://www.pccomponentes.com/msi-mag-b550-tomahawk'
)
console.log(result)