ScrapeSome
Welcome to the documentation for ScrapeSome โ a modern, async/sync-capable web scraping library with smart fallbacks and HTML formatting.
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
andpytest-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