News Feed Forums General Web Scraping How can I scrape product details, seller ratings, delivery Shoptime Brazil?

  • How can I scrape product details, seller ratings, delivery Shoptime Brazil?

    Posted by Coronis Osmond on 12/12/2024 at 10:16 am

    To scrape the product details from Shoptime Brazil, you can use Playwright in Python to handle dynamic content. The product name and description are usually found within div or h1 tags. Use Playwright’s locator() function to wait for the element and extract the text.

    from playwright.sync_api import sync_playwright
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()
        page.goto('https://www.shoptime.com.br/produto-page')
        # Scrape product details
        product_name = page.locator('.product-title').inner_text()
        description = page.locator('.product-description').inner_text()
        print(f"Product Name: {product_name}")
        print(f"Description: {description}")
        browser.close()
    
    Ariah Alfred replied 1 week, 2 days ago 3 Members · 2 Replies
  • 2 Replies
  • Paula Odalys

    Member
    12/13/2024 at 7:36 am

    For seller ratings, you can use Playwright to locate and extract ratings, which are usually displayed alongside the seller’s name or in a span with stars or numeric values. Playwright ensures you wait for the page to load fully before accessing the DOM.

    from playwright.sync_api import sync_playwright
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()
        page.goto('https://www.shoptime.com.br/produto-page')
        # Scrape seller ratings
        seller_rating = page.locator('.seller-rating').inner_text()
        print(f"Seller Rating: {seller_rating}")
        browser.close()
    
  • Ariah Alfred

    Member
    12/13/2024 at 8:34 am

    To scrape delivery options, locate the section that lists shipping costs, times, or options such as express delivery. With Playwright, you can extract this information by targeting the appropriate element and printing its content.

    from playwright.sync_api import sync_playwright
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()
        page.goto('https://www.shoptime.com.br/produto-page')
        # Scrape delivery options
        delivery_info = page.locator('.delivery-options').inner_text()
        print(f"Delivery Options: {delivery_info}")
        browser.close()
    

Log in to reply.