parsera is a free, open source data extraction & web scraping project written in Python and released under GPL-2.0. It has 1,356 GitHub stars, 78 forks and 4 open issues, and was last pushed 9 months ago. On this registry it ranks #39 of 45 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available.

What is parsera?

What it is

Parsera lightweight Python library scraping websites with LLMs. It sits in Python web scraping and data extraction ecosystem. Listing puts it under Data & Analytics / Data Extraction & Web Scraping. License is GPL-2.0. Project page lists 1356 stars, 78 forks, 4 open issues, 2 year age, and last push date 2025-12-17T10:58:19Z. Topics connect it to AI scraping, Playwright, open source data extraction.

Problem solved: turn target URL and desired field list into structured JSON records without hand written parser. User gives page address and names values to collect, such as Title, Points, Comments. Parsera returns list of records for page. README shows news.ycombinator.com example and JSON output shape.

Key capabilities

  • run interface through Parsera(), scraper.run(url=url, elements=elements), returns JSON records.
  • async method arun for nonblocking workflows.
  • Jupyter Notebook support via nest_asyncio.apply() or async arun.
  • CLI path via python -m parsera.main, elements supplied as JSON string or FILE.
  • CLI supports scrolls and output file options.
  • custom models and Playwright scripts possible, per docs and PARSERA_API_KEY setup note.
  • Docker deployment path for local environment issues.

Who uses it and how

  • Python developers extract named fields from web pages, set PARSERA_API_KEY, receive structured JSON output.
  • Data extraction users run notebook tasks interactively.
  • Script users run CLI with URL, scheme, scrolls, output file.
  • Teams or individuals with local dependency problems run Docker instead local Python environment.
  • Users can follow README example for news.ycombinator.com, asking for Title, Points, Comments.

Getting started

README gives pip install parsera and playwright install as basic install path, plus PARSERA_API_KEY setup for library and OPENAI_API_KEY setup for CLI. Basic usage imports Parsera, sets url and elements dictionary, then calls run; Docker and docs.parsera.org cover deployment and further features, and environment variables can be set in Python or .env file.

When to use it — and when not to

Parsera fits small or medium scraping tasks where user wants short Python or CLI workflow and structured JSON from page. It requires LLM access and API key setup, plus Playwright browser installation, so it not pure HTML parser with no external dependencies. Facts show lightweight interface and async, CLI, notebook, Docker paths, but do not describe full managed pipeline, storage layer, or scheduling system; self hoster must operate LLM provider access, browser dependency, and API key handling.

project readme (upstream, from github) — read inline

📦 Parsera

Discord Downloads

Lightweight Python library for scraping websites with LLMs. You can test it on Parsera website.

Why Parsera?

Because it's simple and lightweight. With interface as simple as:

scraper = Parsera()
result = scraper.run(url=url, elements=elements)

Table of Contents

Installation

pip install parsera
playwright install

Documentation

Check out documentation to learn more about other features, like running custom models and playwright scripts.

Basic usage

First, set up PARSERA_API_KEY env variable (If you want to run custom LLM see Custom Models). You can do this from python with:

import os

os.environ["PARSERA_API_KEY"] = "YOUR_PARSERA_API_KEY_HERE"

Next, you can run a basic version:

from parsera import Parsera

url = "https://news.ycombinator.com/"
elements = {
    "Title": "News title",
    "Points": "Number of points",
    "Comments": "Number of comments",
}

scraper = Parsera()
result = scraper.run(url=url, elements=elements)

result variable will contain a json with a list of records:

[
   {
      "Title":"Hacking the largest airline and hotel rewards platform (2023)",
      "Points":"104",
      "Comments":"24"
   },
    ...
]

There is also arun async method available:

result = await scrapper.arun(url=url, elements=elements)

Running with Jupyter Notebook:

Either place this code at the beginning of your notebook:

import nest_asyncio
nest_asyncio.apply()

Or instead of calling run method use async arun.

Running with CLI

Before you run Parsera as command line tool don't forget to put your OPENAI_API_KEY to env variables or .env file

Usage

You can configure elements to parse using JSON string or FILE. Optionally, you can provide FILE to write output and amount of SCROLLS, that you want to do on the page

python -m parsera.main URL {--scheme '{"title":"h1"}' | --file FILENAME} [--scrolls SCROLLS] [--output FILENAME]

Running in Docker

In case of issues with your local environment you can run Parsera with Docker, see documentation.

Frequently asked questions

Is parsera free to use?

parsera is open source under the GPL-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does parsera do?

Lightweight library for scraping web-sites with LLMs

What is parsera written in?

parsera is primarily written in Python. Its source is publicly available at https://github.com/raznem/parsera, and it has 1,356 GitHub stars.