Coder Social home page Coder Social logo

scrapy-spiders's Introduction

License Python

scrapy-spiders

Playwright Scrapy app for scraping products and their images for further finding similar products by photo. Images are stored in directory of project and product data is stored in MongoDB.

Features

  • MongoDB runs in docker container. Scrapy spiders run in regular/virtual environment.
  • Scrapy items have type field that will be a collection name in DB and a directory name for images.
  • User-Agent generator for each request.
  • Custom ScrapeOps proxy.
  • Custom auto-throttler. Standard download delay applies to the list of domains (LIMIT_DOMAINS in settings.py).
  • Exclude products list for unnecessary items specified by type/site/id.
  • Image cleaner tool to keep image data consistent with product database. And image resizer tool for further similarity comparison.
  • MongoDB 4.4 used for compatibility with servers that don't support AVX. Anyway version can be changed to the most fresh 6 or 7. Dump and restore work fine.
  • Spiders can be set on CRON: 0 5 * * * sh /path_to_cron_example.sh 0 20, so as image tools 0 6 * * * python /path_to/products_crawler/tools/image_cleaner.py and 30 6 * * * python /path_to/products_crawler/tools/image_resize.py Example of spider sh file is here products_crawler/cron/example.sh

First-time setup

  1. Set Mongo connection data in .env
  2. Set JD login and ScrapOps API key
  3. Install dependencies with pip install -r requirements.txt
  4. Install Playwright environment with playwright install and dependencies with playwright install-deps
  5. Build and start MongoDB docker compose up -d
  6. Run spider

TODO

scrapy-spiders's People

Contributors

mozgito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.