-
Scrape product name, discount, and shipping from Submarino Brazil using Node.js?
To scrape the product name from Submarino Brazil, you can use Cheerio in Node.js to extract the text from the div or span containing the product title. This is often wrapped in specific classes that you can target using Cheerio’s $(‘.class-name’) syntax. After fetching the page using axios, parse the HTML and extract the product name.
const axios = require('axios'); const cheerio = require('cheerio'); async function scrapeProductName() { const { data } = await axios.get('https://www.submarino.com.br/produto-page'); const $ = cheerio.load(data); const productName = $('.product-title').text(); console.log('Product Name:', productName); } scrapeProductName();
Log in to reply.