Scraping Results Database Storage

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Scraping Results Database Storage
Simple
from 1 business day to 3 business days
FAQ

Our competencies:

Development stages

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1171
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1094
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    831
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    879
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    453

Implementing Scraping Results Storage in Database

Scraping results must not just be saved — they must be saved so you can track change history, make quick queries, and not lose data on re-crawl.

Table Schema

Two levels: raw data and normalized.

-- Raw HTML or JSON response (for debugging and re-parsing)
CREATE TABLE scrape_raw (
    id          BIGSERIAL PRIMARY KEY,
    site_id     INTEGER NOT NULL,
    url         TEXT NOT NULL,
    body        TEXT,
    status_code SMALLINT,
    scraped_at  TIMESTAMP DEFAULT NOW(),
    CONSTRAINT uq_scrape_raw UNIQUE (site_id, url, DATE(scraped_at))
);

-- Normalized products
CREATE TABLE scraped_products (
    id          BIGSERIAL PRIMARY KEY,
    site_id     INTEGER NOT NULL,
    external_id VARCHAR(255),
    url         TEXT NOT NULL,
    name        TEXT,
    price       NUMERIC(12,2),
    currency    CHAR(3),
    in_stock    BOOLEAN,
    data        JSONB,          -- everything else not in columns
    scraped_at  TIMESTAMP DEFAULT NOW(),
    updated_at  TIMESTAMP DEFAULT NOW(),
    CONSTRAINT uq_scraped_product UNIQUE (site_id, external_id)
);

CREATE INDEX idx_scraped_products_site ON scraped_products (site_id);
CREATE INDEX idx_scraped_products_data ON scraped_products USING gin(data);

JSONB column data stores everything not standardized: characteristics, images, attributes. GIN index enables fast content queries.

Upsert on Re-Scrape

def save_product(conn, site_id: int, product: dict):
    conn.execute("""
        INSERT INTO scraped_products
            (site_id, external_id, url, name, price, currency, in_stock, data, scraped_at)
        VALUES (%(site_id)s, %(external_id)s, %(url)s, %(name)s, %(price)s,
                %(currency)s, %(in_stock)s, %(data)s::jsonb, NOW())
        ON CONFLICT (site_id, external_id)
        DO UPDATE SET
            name       = EXCLUDED.name,
            price      = EXCLUDED.price,
            in_stock   = EXCLUDED.in_stock,
            data       = EXCLUDED.data,
            updated_at = NOW(),
            scraped_at = NOW()
    """, {**product, 'site_id': site_id, 'data': json.dumps(product.get('extra', {}))})

Implementation Timeline

Basic schema with upsert logic and indexes — 1–2 business days.