A Powerful Web Scraper with dynamic rendering support.
Project description
ScrapeSome
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.
๐ 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
pytestandpytest-asyncio
๐ฆ Installation
pip install scrapesome
โก Quick Start
Synchronous Example
from scrapesome.scraper.sync_scraper import sync_scraper
html = sync_scraper("https://example.com")
html
Asynchronous Example
import asyncio
from scrapesome.scraper.async_scraper import async_scraper
html = asyncio.run(async_scraper("https://example.com"))
html
๐งฐ Advanced Usage
Force Rendering (Playwright)
from scrapesome.scraper.sync_scraper import sync_scraper
content = sync_scraper("https://example.com", force_playwright=True)
content
Custom User Agents
from scrapesome.scraper.sync_scraper import sync_scraper
content = sync_scraper("https://example.com", user_agents=["MyCustomAgent/1.0"])
content
Control Redirects
from scrapesome.scraper.sync_scraper import sync_scraper
content = sync_scraper("https://example.com", allow_redirects=False)
content
similarly async_scraper can also be used.
๐งช Testing
Run tests with:
pytest --cov=scrapesome tests/
Target coverage: 75โ100%
โ๏ธ Environment Configuration
ScrapeSome reads from environment variables if a .env file is present.
Example .env
LOG_LEVEL=INFO
OUTPUT_FORMAT=text
FETCH_PLAYWRIGHT_TIMEOUT=10
FETCH_PAGE_TIMEOUT=10
USER_AGENTS=["Mozilla/5.0 (Windows NT 10.0; Win64; x64)......."]
| Key | Description |
|---|---|
| FETCH_PLAYWRIGHT_TIMEOUT | Timeout for Playwright-rendered pages (in seconds) |
| FETCH_PAGE_TIMEOUT | Timeout for standard page fetch (in seconds) |
| LOG_LEVEL | Logging verbosity (DEBUG, INFO, WARNING, etc.) |
| OUTPUT_FORMAT | Default output format (text, markdown, json, html) |
| USER_AGENTS | Default user agents ("Mozilla/5.0 (Windows NT 10.0; Win64; x64).......") |
๐ Output Formats
JSON Example
Get json version
from scrapesome.scraper.sync_scraper import sync_scraper
content = sync_scraper("https://example.com", output_format_type="json")
content
Output
{
"title": "Example Domain",
"description": "This domain is for use in illustrative examples.",
"url": "https://example.com"
}
Markdown
Convert HTML to Markdown with:
from scrapesome.scraper.sync_scraper import sync_scraper
content = sync_scraper("https://adenuniversity.us", output_format_type="markdown")
content
Output
# Online Global Masters that boost your global career
**ADENย University** offers students access to professionals who operate in the world of business and administration, who share their knowledge and acumen collaboratively with their students in all **academic programs** offered at ADEN.
[About Us](about-aden-university)
Watch testimonial video
##### Watch testimonial video
ร
[
](https://res.cloudinary.com/cruminott/video/upload/vc_auto,w_auto,q_auto,f_auto/adenu/aden-university-3.mp4)
## ADEN University offers the following academic programs
[](https://adenuniversity.us/academics/executive-mba/ "EXECUTIVE MBA. Master of Business Administration")
##### [EXECUTIVE MBA. Master of Business Administration](https://adenuniversity.us/academics/executive-mba/ "EXECUTIVE MBA. Master of Business Administration")
The ADEN University Executive MBA is designed to strengthen business leaders to manage...
* **37** credits
* **15** months
* **Spanish Only**
[Visit EMBA Course](https://adenuniversity.us/academics/executive-mba/ "EXECUTIVE MBA. Master of Business Administration")
[](https://adenuniversity.us/academics/global-mba/ "GLOBAL MBA. Master of Business Administration")
##### [GLOBAL MBA. Master of Business Administration](https://adenuniversity.us/academics/global-mba/ "GLOBAL MBA. Master of Business Administration")
The Global MBA is designed to prepare business leaders to manage companies in an...
* **36** credits
* **14** months
* **Spanish and English**
similarly async_scraper can also be used.
๐ Project Structure
scrapesome/
โโโ .gitignore
โโโ pytest.ini
โโโ .github/
โ โโโ workflows/
โ โโโ deploy.yml
โโโ __init__.py
โโโ config.py
โโโ exceptions.py
โโโ formatter/
โ โโโ __init__.py
โ โโโ output_formatter.py
โโโ logging.py
โโโ scraper/
โ โโโ __init__.py
โ โโโ async_scraper.py
โ โโโ sync_scraper.py
โ โโโ rendering.py
โโโ docs/
โ โโโ index.md
โ โโโ getting_started.md
โ โโโ usage.md
โ โโโ config.md
โ โโโ examples.md
โ โโโ about.md
โ โโโ licence.md
โโโ tests/
โ โโโ __init__.py
โ โโโ test_sync_scraper.py
โ โโโ test_async_scraper.py
โ โโโ test_config.py
โโโ setup.py
โโโ requirements.txt
โโโ pyproject.toml
โโโ LICENSE
โโโ README.md
๐ License
MIT License ยฉ 2025
๐ค Contributions
Contributions are welcome! Whether it's bug reports, feature suggestions, or pull requests โ your help is appreciated.
To get started:
git clone https://github.com/scrapesome/scrapesome.git
cd scrapesome
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrapesome-0.0.5.tar.gz.
File metadata
- Download URL: scrapesome-0.0.5.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb153ea5df4d1db8c6ad317711cdf888844c60e50b0606e0221ab884a82c462
|
|
| MD5 |
17cc9a52834d93441d21f2bcf34d9ee4
|
|
| BLAKE2b-256 |
eddac3bd56599363f371b1faf4c4c4e61864c1dcb5db822c6ff86ce6dd24212a
|
File details
Details for the file scrapesome-0.0.5-py3-none-any.whl.
File metadata
- Download URL: scrapesome-0.0.5-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d720367aafa67131ea96cb79fbeb36d753baca84fc6b73500b6d4a8e1e55897
|
|
| MD5 |
3d3cac95c12a011faddb1a64fb9d9987
|
|
| BLAKE2b-256 |
3f50d288a8edb2492d39f98a8c053d8e93df90567f3b736231360d2e5a0b85f9
|