Skip to content

ScrapeSome

Welcome to the documentation for ScrapeSome โ€” a modern, async/sync-capable web scraping library with smart fallbacks and HTML formatting.

Scrapesome Logo

ScrapeSome is a lightweight, flexible web scraping library with both synchronous and asynchronous support. It includes intelligent fallbacks, JavaScript page rendering, response formatting (HTML โ†’ Text/JSON/Markdown), and retry mechanisms. Ideal for developers who need robust scraping utilities with minimal setup.


๐Ÿ’ก Why Use ScrapeSome?

  • Handles both static and JS-heavy pages out of the box
  • Supports both sync and async scraping
  • Converts raw HTML into clean text, JSON, or Markdown
  • Works with minimal configuration (pip install scrapesome)
  • Handles timeouts, retries, redirects, user agents

๐Ÿš€ Features

  • ๐Ÿ” Sync + Async scraping support
  • ๐Ÿ”„ Automatic retries and intelligent fallbacks
  • ๐Ÿงช Playwright rendering fallback for JS-heavy pages
  • ๐Ÿ“ Format responses as raw HTML, plain text, Markdown, or structured JSON
  • โš™๏ธ Configurable: timeouts, redirects, user agents, and logging
  • ๐Ÿงช Test coverage with pytest and pytest-asyncio

โš– Comparison with Alternatives

Feature ScrapeSome โœ… Playwright (Python) Selenium + UC Requests-HTML Scrapy + Playwright
๐Ÿง  JS Rendering Support โœ… Auto fallback on 403/JS content โœ… Always (manual control) โœ… Always (manual control) โœ… Partial (via Pyppeteer) โœ… Requires setup
๐Ÿ”„ Automatic Fallback (403/Blank) โœ… Yes (seamless) โŒ Manual logic needed โŒ Manual logic needed โŒ No โŒ Needs per-request config
๐Ÿ” Uses Browser Engine โœ… Only when needed (Playwright) โœ… Always โœ… Always โœ… (Unstable, slow) โœ… Always (if enabled)
โœ… Sync + Async Support โœ… Built-in โŒ Async only โŒ Manual (via threading) โŒ Sync only โŒ Async only (via plugin)
๐Ÿ“ JSON/Markdown/HTML Output โœ… Built-in formats โŒ Manual parsing โŒ Manual parsing โŒ Basic only โŒ Custom pipeline needed
โšก Minimal Setup โœ… Near zero โŒ Code + browser install โŒ Driver + setup โœ… Simple pip install โŒ Complex + plugin setup
๐Ÿ” Retries, Timeouts, Agents โœ… Smart defaults built-in โŒ Manual handling โŒ Manual handling โŒ Limited โš ๏ธ Partial via settings
๐Ÿงช Pytest-Ready Out-of-the-box โœ… Fully testable โš ๏ธ Requires mocks โŒ Hard to test โŒ Minimal โš ๏ธ Needs testing harness
โš™๏ธ Config via .env / Inline โœ… Flexible and optional โŒ Code/config only โŒ Manual via code โŒ Hardcoded mostly โš ๏ธ Project settings
๐Ÿ“ฆ Install & Run in <1 Min โœ… Yes โŒ Setup required โŒ Driver + config needed โœ… Yes โŒ Needs project + plugin

๐Ÿ“ฆ Installation

pip install scrapesome

๐Ÿงช Testing

Run tests with:

pytest --cov=scrapesome tests/

Target coverage: 75โ€“100%

๐Ÿ“ Project Structure

scrapesome/
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ pytest.ini
โ”œโ”€โ”€ mkdocs.yml
โ”œโ”€โ”€ .github/
โ”‚   โ”œโ”€โ”€ workflows/
โ”‚   โ”‚   โ””โ”€โ”€ deploy.yml
โ”‚   โ”œโ”€โ”€ ISSUE_TEMPLATE/
โ”‚   โ”‚   โ””โ”€โ”€ index.md
โ”‚   โ”œโ”€โ”€ PULL_REQUEST_TEMPLATE.md
โ”‚   โ”œโ”€โ”€ CODE_OF_CONDUCT.md
โ”‚   โ””โ”€โ”€ SECURITY.md
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ cli.py
โ”œโ”€โ”€ config.py
โ”œโ”€โ”€ exceptions.py
โ”œโ”€โ”€ formatter/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ output_formatter.py
โ”œโ”€โ”€ logging.py
โ”œโ”€โ”€ scraper/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ async_scraper.py
โ”‚   โ”œโ”€โ”€ sync_scraper.py
โ”‚   โ””โ”€โ”€ rendering.py
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ file_writer.py
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ index.md
โ”‚   โ”œโ”€โ”€ getting_started.md
โ”‚   โ”œโ”€โ”€ usage.md
โ”‚   โ”œโ”€โ”€ config.md
โ”‚   โ”œโ”€โ”€ examples.md
โ”‚   โ”œโ”€โ”€ cli.md
โ”‚   โ”œโ”€โ”€ about.md
โ”‚   โ”œโ”€โ”€ licence.md
โ”‚   โ”œโ”€โ”€ file-saving.md
โ”‚   โ”œโ”€โ”€ contribution.md
โ”‚   โ”œโ”€โ”€ output-formats.md
โ”‚   โ””โ”€โ”€ assets/
โ”‚       โ””โ”€โ”€ images/
โ”‚           โ””โ”€โ”€ favicon.png
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_sync_scraper.py
โ”‚   โ”œโ”€โ”€ test_async_scraper.py
โ”‚   โ”œโ”€โ”€ test_config.py
โ”‚   โ”œโ”€โ”€ test_logging.py
โ”‚   โ”œโ”€โ”€ test_rendering.py
โ”‚   โ”œโ”€โ”€ test_file_writer.py
โ”‚   โ”œโ”€โ”€ test_output_formatter.py
โ”‚   โ””โ”€โ”€ test_cli.py
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ README.md

๐Ÿ”’ License

MIT License ยฉ 2025