Scrapy

64.5k GitHub starsscrapy/scrapy

A fast, long-trusted Python tool for collecting information from large websites and saving it as tidy data you can use.

View on GitHub

Build a stack with Scrapy

Pick parts from it and the projects that work well with it. We check the licences together and write a prompt for your AI.

Scrapy
Playwright

Your stack

Tick the parts you want to use. Projects whose parts are not listed yet can be added whole; the prompt tells your AI to find the right pieces in their code.

Website (opens in a new tab)
More actions

Why we picked it

Scrapy has been the go-to tool for collecting data from websites for well over a decade, and it's still one of the fastest. It can get through thousands of pages on an ordinary computer because it doesn't open a browser for each one. It's mature and well documented, and a big community has built add-ons for almost any job. The licence is one of the most relaxed around.

About Scrapy

Say you want every product and price from an online shop, or every article on a news site. Copying them by hand would take weeks. Scrapy does it for you: you describe which links to follow and which details to pick out of each page, and it visits the pages and saves what it finds as tidy data, like a spreadsheet file. It's a Python library, so you write a small amount of code to tell it what to do.

What it can do

  • Get through big sites quickly. It fetches many pages at once and slows itself down automatically so it doesn't overload the site.
  • Pick out exactly what you need. You point at the parts of a page you want, such as a title, a price or a date, and it pulls them out of every page the same way.
  • Tidy up as it goes. Clean, check and filter each result before it's saved, and skip the duplicates.
  • Save it how you like. Results come out as common file types (JSON, CSV or XML), or go straight into your own database.
  • Grow with add-ons. Extras for logging in, retrying failed pages, working through other networks and much more, most of them free.

Where it fits

Scrapy is at its best on large sites where the information is already in the page when it arrives, like most shops, directories and news sites. It turns a whole site into rows of data that you can then analyse, search or hand to an AI. Some modern sites only show their content after they load in a browser. For those, an add-on called scrapy-playwright lets Scrapy open pages in a real browser, or you can use Crawl4AI or Crawlee instead.

Good to know

  • You need to be comfortable with some Python. It's a toolkit for building your own collector, not an app you click through.
  • Out of the box it reads pages as they arrive and doesn't run them in a browser, so content that appears later won't be there without the add-on above.
  • It gives you data, not clean text for AI. If you want pages turned into readable text for a chatbot, Crawl4AI does that for you.
  • Crawl politely: new projects follow each site's rules (its robots.txt file) by default, so keep that on, and respect sites' terms of use.
  • Licence: BSD 3-Clause. You can use it for free, including in paid products; just keep the copyright notice.

What you can build with it

  • Collecting product names and prices from an online shop into a spreadsheet
  • Gathering job listings, property ads or events from many sites into one place
  • Saving a copy of a large website's pages for research or archiving
  • Checking a site regularly and saving what's new or changed
  • Building a dataset to train or test an AI model

Building blocks

Scrapy is made of parts you can use on their own in your project. Copy a prompt to have your AI assistant add one for you, and see the licence card for what you may do with them.

  • The crawling framework

    Free to use, even in closed products

    The Scrapy framework and command-line tool: spiders, selectors, pipelines and feed exports for crawling sites and extracting data.

    Use it to build

    • Large static-site crawls
    • Structured data extraction
    • Scheduled data collection
    View code
    Technical details
    Name
    scrapy
    What it is
    Code library
    How to use it
    Install it, then configure it
    Install
    pip install scrapy
    Licence
    BSD 3-Clause (read from LICENSE)
  • Browser rendering for Scrapy

    Free to use, even in closed products

    Lets Scrapy load chosen pages in a real browser through Playwright, for sites that build their content with JavaScript.

    Use it to build

    • JavaScript-heavy pages in Scrapy
    • Mixed static and dynamic sites
    View code
    Technical details
    Name
    scrapy-playwright
    What it is
    Plugin
    How to use it
    Install it, then configure it
    Install
    pip install scrapy-playwright && playwright install
    Licence
    BSD 3-Clause (read from scrapy-plugins/scrapy-playwright/LICENSE)

Works well with

  • Playwright

    96.6k GitHub stars

    Lets your code open a real browser and click, type and read pages like a person. Used to test websites, collect data and give AI assistants a browser.

    • Browser automation & testing
    • Web scraping & crawling
    • Apache 2.0

Comments

No comments yet. Be the first to share your thoughts.