Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
javascript - grab title, price and color of product from webpage

What I want: From the below URL, I would like to grab: Title, Was Price, Now Price, all colors aviable

https://www.michaelkors.com/mercer-gallery-medium-logo-tote-bag/_/R-US_30F1GZ5T6B?color=2170

  • Title = Mercer Gallery Medium Logo Tote Bag
  • Was Price = $398.00
  • Now Price = $149.00
  • Color = BRN/SFTPINK, BRN/ACORN

After inspecting URL code, I need to grab data from the following classes product-name, listPrice and salePrice

Error: Access to XMLHttpRequest at 'https://www.michaelkors.com/greenwich-extra-small-studded-patent-leather-crossbody-bag/_/R-US_32F1GGRC5L?color=2711' from origin 'https://localhost:44329' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

What I Tried:

var url = 'https://www.michaelkors.com/mercer-gallery-medium-logo-tote-bag/_/R-US_30F1GZ5T6B?color=2170';

        var TitleClass = 'product-name';



        fetch(url)
            .then(res => res.text())
            .then(text => {
                document.getElementById('DisplayWebCode').innerHTML = text;
                console.log(text);
            })
            .catch(err => console.log(err));
<div id="DisplayWebCode">

    </div>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

What you're trying to achieve is possible. Just not on browser javascript. You'll need NodeJS.
You can use web scraping technologies to render out web pages and extract the title, price etc. in the backend and serve that in an API and then make a fetch request to that from your frontend. You can use Puppeteer to do the scraping bit. Please check out Puppeteer for more info.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda