Scraping via Scrapy (Python)

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 via Scrapy (Python)
Medium
~3-5 business days
FAQ

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1262
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1171
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    874
  • 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_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    851

Implementation of Scraping via Scrapy (Python)

Scrapy is an industrial web scraping framework for Python. Not just a library, but a full architecture: built-in request queue, middleware system, pipeline for data processing, built-in robots.txt support, user-agent auto-rotation, response caching. If you need to collect data from hundreds of pages in parallel—Scrapy is the right choice.

Scrapy Architecture

Spider (traversal logic)
    ↓
Scrapy Engine
    ↓
Scheduler (URL queue)
    ↓
Downloader (HTTP requests)
    ↓ (via Downloader Middlewares)
Response → Spider
    ↓
Items → Item Pipeline
    ↓
Storage (DB, CSV, JSON, S3)

Each component is replaceable: can plug in custom queue (Redis via scrapy-redis), custom downloader (Playwright via scrapy-playwright), or custom pipeline.

Basic Spider

import scrapy

class CatalogSpider(scrapy.Spider):
    name = 'catalog'
    start_urls = ['https://example.com/catalog?page=1']

    def parse(self, response):
        for item in response.css('.product-card'):
            yield {
                'title': item.css('.title::text').get('').strip(),
                'price': item.css('.price::attr(data-value)').get(),
                'url': response.urljoin(item.css('a::attr(href)').get()),
            }

        next_page = response.css('a.next-page::attr(href)').get()
        if next_page:
            yield response.follow(next_page, self.parse)

Scaling via scrapy-redis

For distributed collection on multiple servers:

# settings.py
SCHEDULER = 'scrapy_redis.scheduler.Scheduler'
DUPEFILTER_CLASS = 'scrapy_redis.dupefilter.RFPDupeFilter'
REDIS_URL = 'redis://redis:6379'
SCHEDULER_PERSIST = True  # queue doesn't clear on restart

With scrapy-redis multiple workers read from shared Redis queue—horizontal scaling without code changes.

Middleware for Protection Bypass

class RotateUserAgentMiddleware:
    agents = [
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...',
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...',
    ]

    def process_request(self, request, spider):
        request.headers['User-Agent'] = random.choice(self.agents)

Additionally: scrapy-rotating-proxies for automatic proxy rotation with status tracking per address.

Pipeline for PostgreSQL

class PostgreSQLPipeline:
    def open_spider(self, spider):
        self.conn = psycopg2.connect(DATABASE_URL)
        self.cur = self.conn.cursor()

    def process_item(self, item, spider):
        self.cur.execute(
            'INSERT INTO products (title, price, url) VALUES (%s, %s, %s) '
            'ON CONFLICT (url) DO UPDATE SET price = EXCLUDED.price',
            (item['title'], item['price'], item['url'])
        )
        self.conn.commit()
        return item

ON CONFLICT DO UPDATE solves deduplication at DB level without extra checks in code.

Monitoring and Statistics

Scrapy logs detailed statistics of each run: request count, items processed, errors, average response time. Via scrapy-prometheus these metrics export to Prometheus and visualize in Grafana.

Timeline

Spider for one site with pipeline and basic middleware: 3–5 days. Distributed system with Redis, monitoring, multiple source adapters: 10–15 days.