Skip to main content

PyScrappy: robust, all-in-one Python web scraping toolkit

Python 3.9+ PyPI Latest Release License: MIT Downloads

PyScrappy is a Python toolkit for web scraping that works out of the box. Point it at any URL and get structured data back — or use built-in scrapers for Wikipedia, IMDB, Yahoo Finance, news feeds, and more.

Key features

  • Generic scraper — give it any URL, get back structured text, links, images, tables, and metadata
  • Auto-pagination — automatically follows "next page" links
  • JS rendering — optional Playwright backend for JavaScript-heavy sites
  • Custom selectors — pass CSS selectors to extract exactly what you need
  • Built-in scrapers — Wikipedia, IMDB, Yahoo Finance, news (RSS), image search, Amazon, LinkedIn
  • Clean API — every scraper returns a ScrapeResult with .to_dataframe() and .to_json()
  • Retry & rate-limiting — built-in exponential backoff and per-domain rate limiting
  • Type-safe — full type hints, py.typed marker

Installation

pip install pyscrappy

Optional extras:

# Browser support (for JS-rendered pages)
pip install 'pyscrappy[browser]'
playwright install chromium

# DataFrame support
pip install 'pyscrappy[dataframe]'

# MCP server (use PyScrappy's scrapers as AI-agent tools)
pip install 'pyscrappy[mcp]'

# Everything
pip install 'pyscrappy[all]'

Quick start

Scrape any URL (one-liner)

from pyscrappy import scrape

result = scrape("https://en.wikipedia.org/wiki/Web_scraping")
print(result.data[0]["metadata"]["title"])
print(result.data[0]["text"]["word_count"])

Custom CSS selectors

from pyscrappy import GenericScraper

with GenericScraper() as gs:
    result = gs.scrape(
        url="https://news.ycombinator.com",
        selectors={"title": ".titleline a", "score": ".score"},
    )
    for item in result.data:
        print(item["title"], item.get("score", ""))

Wikipedia

from pyscrappy import WikipediaScraper

with WikipediaScraper() as ws:
    result = ws.scrape(query="Python (programming language)", mode="summary")
    print(result.data[0]["text"])

Stock data

from pyscrappy import StockScraper

with StockScraper() as ss:
    result = ss.scrape(symbol="AAPL", mode="history", period="1mo")
    df = result.to_dataframe()
    print(df.head())

IMDB (via OMDb API)

IMDB's own pages are protected by an anti-bot challenge, so PyScrappy fetches IMDB data through the free OMDb API. Set an OMDb API key in the OMDB_API_KEY environment variable (or pass api_key=...).

from pyscrappy import IMDBScraper

with IMDBScraper() as scraper:      # reads OMDB_API_KEY from the environment
    # Search by title
    result = scraper.scrape(query="inception")
    # ...or look up a specific IMDB id
    result = scraper.scrape(query="tt1375666")
    df = result.to_dataframe()
    print(df[["title", "year", "rating", "genre"]])

News (RSS feeds)

from pyscrappy import NewsScraper

with NewsScraper() as ns:
    result = ns.scrape(feed_url="https://rss.nytimes.com/services/xml/rss/nyt/World.xml")
    for article in result.data[:5]:
        print(article["title"])
from pyscrappy import ImageSearchScraper

with ImageSearchScraper() as iss:
    result = iss.scrape(query="golden retriever", max_images=10, download_to="./dogs")

Configuration

from pyscrappy import ScraperConfig, GenericScraper

config = ScraperConfig(
    timeout=20.0,            # request timeout in seconds
    max_retries=3,           # retry failed requests
    rate_limit=2.0,          # seconds between requests per domain
    proxy="http://...",      # HTTP/SOCKS proxy
    headless=True,           # browser runs headless
    render_js="auto",        # auto-detect if JS rendering is needed
)

with GenericScraper(config) as gs:
    result = gs.scrape(url="https://example.com")

YouTube

from pyscrappy import YouTubeScraper

with YouTubeScraper() as scraper:
    result = scraper.scrape(query="python tutorial", max_results=10)
    for video in result.data:
        print(video["title"], video.get("views", ""))

SoundCloud

from pyscrappy import SoundCloudScraper

with SoundCloudScraper() as scraper:
    result = scraper.scrape(query="lo-fi beats", max_results=10)

E-Commerce (Alibaba, Flipkart, Snapdeal)

from pyscrappy import AlibabaScraper, FlipkartScraper, SnapdealScraper

with FlipkartScraper() as scraper:
    result = scraper.scrape(query="laptop", max_pages=2)
    df = result.to_dataframe()

Food Delivery (Swiggy, Zomato)

from pyscrappy import SwiggyScraper, ZomatoScraper

# These are JS-heavy — use render_js=True for best results
with SwiggyScraper() as scraper:
    result = scraper.scrape(city="bangalore", render_js=True)

Built-in scrapers

Scraper What it does Needs browser?
GenericScraper Scrape any URL with auto-extraction Optional
Data / Research
WikipediaScraper Articles, sections, infoboxes No
IMDBScraper Movie/TV info by title or id (via OMDb API; needs OMDB_API_KEY) No
StockScraper Quotes, history, profiles (Yahoo Finance) No
NewsScraper RSS/Atom feeds, article extraction No
ImageSearchScraper Image search + download No
LinkedInJobsScraper Public job listings No
E-Commerce
AmazonScraper Product search No
AlibabaScraper Product search No
FlipkartScraper Product search No
SnapdealScraper Product search No
Social Media
YouTubeScraper Video search, channel scraping Optional
InstagramScraper Profiles, hashtag posts Recommended
TwitterScraper Tweet search Recommended
Music
SpotifyScraper Track/playlist search Recommended
SoundCloudScraper Track search Optional
Food Delivery
SwiggyScraper Restaurant listings Recommended
ZomatoScraper Restaurant listings Recommended

MCP server (use PyScrappy from an AI agent)

PyScrappy ships an optional Model Context Protocol server, so an AI agent (e.g. Claude) can call PyScrappy's scrapers as tools and get structured web data back.

pip install 'pyscrappy[mcp]'

This installs a pyscrappy-mcp command (a stdio MCP server). You can also run it with python -m pyscrappy.mcp.

Register with Claude Code

claude mcp add pyscrappy pyscrappy-mcp

Register with Claude Desktop

Add to your claude_desktop_config.json and restart the app:

{
  "mcpServers": {
    "pyscrappy": {
      "command": "pyscrappy-mcp"
    }
  }
}

Tip: Claude Desktop does not inherit your shell PATH. If pyscrappy-mcp is not found, use the absolute path to the command (e.g. the one printed by which pyscrappy-mcp).

Available tools

Tool Description
scrape_url Scrape any URL — text, links, images, tables, metadata
scrape_wikipedia Fetch a Wikipedia article (full / paragraphs / headers)
scrape_stock Yahoo Finance quotes, history, and profiles
scrape_news RSS/Atom feeds, auto-discovered site feeds, or a single article
search_images Image search (returns URLs + metadata)
search_youtube YouTube video search
search_linkedin_jobs Public LinkedIn job listings
search_soundcloud SoundCloud track search (uses the browser backend)
lookup_movie Movie/TV info from IMDB by title or id (via OMDb; needs OMDB_API_KEY)
scrape_zomato Restaurant listings by city

The lookup_movie tool needs a free OMDb API key. Pass it to the server through your MCP client config, e.g. for Claude Desktop:

{
  "mcpServers": {
    "pyscrappy": {
      "command": "pyscrappy-mcp",
      "env": { "OMDB_API_KEY": "your-key" }
    }
  }
}

Once registered, just ask the agent naturally, e.g. "use pyscrappy to get the latest headlines from bbc.co.uk and the AAPL stock quote."

Dependencies

Required: httpx, beautifulsoup4, lxml

Optional: playwright (JS rendering), pandas (DataFrames), mcp (MCP server)

License

MIT

Contributing

All contributions welcome. See Issues.

This package is for educational and research purposes.

Metadata

Release files for pyscrappy 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyscrappy 1.1.1
File Size Uploaded
pyscrappy-1.1.1.tar.gz 86.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyscrappy 1.1.1
File Interpreter ABI Platform
pyscrappy-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 147.1 kB

Release files / pyscrappy-1.1.1.tar.gz

Download URL pyscrappy-1.1.1.tar.gz
Size 86.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2343826feab3c28e29677c91b9417d734c384379f9d83c5b670951919791bd98
BLAKE2b-256 checksum
How to use checksums
1001f597842330c8f8c767726f4113922690a9c166342ff6ea8cd9205af5df9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / pyscrappy-1.1.1-py3-none-any.whl

Download URL pyscrappy-1.1.1-py3-none-any.whl
Size 60.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
476e2b80d6377dae9e35ece86f8086b5886fe1a72e0406482d744625e514f531
BLAKE2b-256 checksum
How to use checksums
013ddfcf3f90aa729f28799bf9404e62b8bf51b063561e3c2a2be4852c579e74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page