Forum Replies Created

  • To extract shipping details, locate the section that shows delivery options, such as estimated delivery dates or shipping costs. Using Selenium, find and extract the text from the relevant div or span elements.

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    driver = webdriver.Chrome()
    driver.get('https://www.amazon.com.br/dp/product-page')
    # Scrape shipping details
    shipping = driver.find_element(By.CSS_SELECTOR, '.shipping-info').text
    print('Shipping Details:', shipping)
    driver.quit()
    
  • To extract the price, use Puppeteer to target the element containing the pricing information, typically within a span or div. Ensure the element is loaded by waiting for the selector before extracting the text. This ensures accurate price scraping.

    const puppeteer = require('puppeteer');
    (async () => {
        const browser = await puppeteer.launch({ headless: true });
        const page = await browser.newPage();
        await page.goto('https://www.pontofrio.com.br/product-page');
        // Scrape price
        const price = await page.$eval('.product-price', el => el.innerText);
        console.log('Price:', price);
        await browser.close();
    })();