News Feed Forums General Web Scraping Scrape product description, images, and seller information -Americanas Brazil?

  • Scrape product description, images, and seller information -Americanas Brazil?

    Posted by Prashant Sanjiv on 12/12/2024 at 7:17 am

    To scrape the product description from Americanas Brazil, you can use Selenium with Python to load the page and extract the text. The description is usually within a div or span with a specific class. After navigating to the product page, you can use find_element_by_xpath() or find_element_by_css_selector() to locate and extract the description text.

    from selenium import webdriver
    # Set up Selenium WebDriver
    driver = webdriver.Chrome()
    # Open the product page
    driver.get('https://www.americanas.com.br/produto-page')
    # Scrape the product description
    description = driver.find_element_by_css_selector('.product-description').text
    print('Product Description:', description)
    driver.quit()
    
    Eliana Yoel replied 1 week, 1 day ago 3 Members · 2 Replies
  • 2 Replies
  • Rorie Subhadra

    Member
    12/13/2024 at 7:11 am

    When scraping product images from Americanas Brazil, Selenium allows you to interact with the page and locate the image elements using xpath or css selectors. Product images are typically in img tags, and you can extract the src attribute to get the image URL. It’s useful to check for multiple images if the product has variations.

    from selenium import webdriver
    # Set up the driver
    driver = webdriver.Chrome()
    # Navigate to the product page
    driver.get('https://www.americanas.com.br/produto-page')
    # Scrape image URLs
    images = driver.find_elements_by_css_selector('.product-images img')
    for img in images:
        print('Product Image URL:', img.get_attribute('src'))
    driver.quit()
    
  • Eliana Yoel

    Member
    12/14/2024 at 7:09 am

    To scrape seller information from Americanas Brazil, you can use Selenium to locate the seller’s details, which are often displayed as text or in a separate section. By targeting the seller’s name, contact info, or ratings, you can collect this data for each product. Be sure to handle cases where the seller information may not be available for every listing.

    from selenium import webdriver
    # Set up the WebDriver
    driver = webdriver.Chrome()
    # Open the product page
    driver.get('https://www.americanas.com.br/produto-page')
    # Scrape seller information
    seller = driver.find_element_by_css_selector('.seller-info .seller-name').text
    print('Seller Name:', seller)
    driver.quit()
    

Log in to reply.