Skip to main content

A resilient e-commerce scraper using JSON-LD metadata. Works with VTEX, Shopify, and major retail platforms.

Project description

🛒 Universal Shop Scraper

PyPI version License: MIT Python 3.8+

Universal Shop Scraper é uma biblioteca Python focada em extração confiável e escalável de dados de e-commerce, utilizando metadados estruturados JSON-LD (Schema.org) em vez de scraping tradicional baseado em HTML.

Projetada para cenários reais de engenharia de dados, monitoramento de preços e inteligência competitiva.


🎯 Proposta

Scrapers tradicionais quebram quando o frontend muda.
Esta biblioteca ignora completamente o layout e extrai diretamente da camada semântica usada por mecanismos de busca.

✔ Menos manutenção
✔ Mais estabilidade
✔ Dados estruturados por padrão


⚙️ Como Funciona

  1. Requisição HTTP da página
  2. Extração de <script type="application/ld+json">
  3. Parsing dos dados estruturados
  4. Normalização para um formato consistente

📦 Instalação

pip install universal-shop-scraper

🔍 Extração de Produto

from universal_shop_scraper import ShopScraper

scraper = ShopScraper()

data = scraper.get_product("https://www.kabum.com.br/produto/626864/")

if "error" not in data:
    print(data)

Exemplo de saída

{
  "name": "Fritadeira Air Fryer Elgin",
  "price": 349.90,
  "currency": "BRL",
  "sku": "1878799",
  "brand": "Elgin",
  "availability": true,
  "url": "https://..."
}

📊 Processamento em Lote

from universal_shop_scraper import ShopScraper

urls = [
    "https://www.gbarbosa.com.br/produto-x",
    "https://www.kabum.com.br/produto-y",
    "https://www.magalu.com.br/produto-z"
]

scraper = ShopScraper()
scraper.save_to_csv(urls, filename="dataset.csv")

🧠 Integração com Data Science

import pandas as pd
from universal_shop_scraper import ShopScraper

urls = [...]
scraper = ShopScraper()

data = [scraper.get_product(url) for url in urls]
df = pd.DataFrame(data)

print(df.head())

📊 Estrutura dos Dados

Campo Tipo Descrição
name str Nome do produto
price float Preço
currency str Moeda
sku str Identificador do produto
brand str Marca
availability bool Disponibilidade
url str URL de origem

⚠️ Limitações

  • Nem todos os sites implementam JSON-LD corretamente
  • Alguns dados podem estar ausentes ou inconsistentes
  • Sites altamente dinâmicos podem não expor metadata no HTML inicial

Distribuído sob a licença MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

universal_shop_scraper-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

universal_shop_scraper-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file universal_shop_scraper-0.1.0.tar.gz.

File metadata

  • Download URL: universal_shop_scraper-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for universal_shop_scraper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 802493dc8d8f44b0dcd619f8b8ad118141733e9b45524249a680172469392bb8
MD5 ce9d6b283723f4f2f3430742854aa5ca
BLAKE2b-256 ae73ba9850cc7d57790b3ba09ac6108c17164ab91151f64cb4aaabfa6d269026

See more details on using hashes here.

File details

Details for the file universal_shop_scraper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for universal_shop_scraper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22fe7a2183d57cba57c4632cf854c6dc7ea84c922ae00fb741c1dddfbbbb7cc1
MD5 4ca334c61554e3b60b7d49a8b8576598
BLAKE2b-256 c2955002f2f27aca085dfda9d496593231bb66978c6d6abe05ab644c88c7ee2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page