File size: 1,753 Bytes
9e42181 a185d1b 9e42181 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # Scrapling Examples
These examples scrape [quotes.toscrape.com](https://quotes.toscrape.com) β a safe, purpose-built scraping sandbox β and demonstrate every tool available in Scrapling, from plain HTTP to full browser automation and spiders.
All examples collect **all 100 quotes across 10 pages**.
## Quick Start
Make sure Scrapling is installed:
```bash
pip install "scrapling[all]>=0.4.2"
scrapling install --force
```
## Examples
| File | Tool | Type | Best For |
|--------------------------|-------------------|-----------------------------|---------------------------------------|
| `01_fetcher_session.py` | `FetcherSession` | Python β persistent HTTP | APIs, fast multi-page scraping |
| `02_dynamic_session.py` | `DynamicSession` | Python β browser automation | Dynamic/SPA pages |
| `03_stealthy_session.py` | `StealthySession` | Python β stealth browser | Cloudflare, fingerprint bypass |
| `04_spider.py` | `Spider` | Python β auto-crawling | Multi-page crawls, full-site scraping |
## Running
**Python scripts:**
```bash
python examples/01_fetcher_session.py
python examples/02_dynamic_session.py # Opens a visible browser
python examples/03_stealthy_session.py # Opens a visible stealth browser
python examples/04_spider.py # Auto-crawls all pages, exports quotes.json
```
## Escalation Guide
Start with the fastest, lightest option and escalate only if needed:
```
get / FetcherSession
ββ If JS required β fetch / DynamicSession
ββ If blocked β stealthy-fetch / StealthySession
ββ If multi-page β Spider
```
|