# Scrapling Scraping

> Professional web scraping using Scrapling, Parsel, and BeautifulSoup4. Use this skill to extract data from websites, handle anti-bot protections, and build adaptive, stealthy crawlers.

- Skill: `boonyaritpornuan/scrapling-scraping` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add boonyaritpornuan/scrapling-scraping`
- Raw SKILL.md: https://api.skillmd.com/api/skills/boonyaritpornuan/scrapling-scraping/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: boonyaritpornuan (https://skillmd.com/u/boonyaritpornuan)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/boonyaritpornuan/scrapling-scraping

---


# Scrapling & Advanced Web Scraping

This skill provides advanced patterns for web scraping using `Scrapling`, a high-performance framework, and its underlying engine `Parsel`. It is designed for stealthy data extraction and building crawlers that survive website design changes.

## Core Engines

### 1. Scrapling (High-Performance & Stealth)
Ideal for environments with full browser support (Linux/Windows/macOS).
- **StealthyFetcher**: Bypasses anti-bot systems like Cloudflare.
- **Adaptive Parser**: Automatically finds elements if CSS selectors change.
- **Spider Framework**: Concurrent, multi-session crawling.

### 2. Parsel (Lightweight & Versatile) - LOCAL RECOMMENDED
Recommended for Termux and lightweight environments. It uses CSS and XPath selectors (like Scrapling and Scrapy) but without the heavy browser dependency.
- **Speed**: Extremely fast (built on LXML).
- **Flexibility**: Supports CSS, XPath, and Re (Regex) selectors in one chain.

## Usage Patterns

### Adaptive Scraping (Scrapling)
Use this when you need the script to be robust against site updates.
```python
from scrapling.fetchers import StealthyFetcher
fetcher = StealthyFetcher()
page = fetcher.fetch('https://example.com')
# Use adaptive=True to enable element relocation on failure
title = page.css('h1.title::text', adaptive=True).get()
```

### Lightweight Scraping (Parsel)
Best for Termux. Fast and reliable.
```python
import requests
from parsel import Selector

response = requests.get('https://example.com')
sel = Selector(text=response.text)

# Extract multiple items
items = sel.css('div.item')
for item in items:
    name = item.css('h2::text').get()
    price = item.xpath('.//span[@class="price"]/text()').get()
```

## Anti-Bot Guidance
If you encounter "Access Denied" or Cloudflare:
1. **User-Agent**: Always rotate or set a realistic User-Agent.
2. **Scrapling Stealth**: Use `StealthyFetcher` if available.
3. **Cloudscraper**: Use `cloudscraper` as a drop-in replacement for `requests`.

See [REFERENCES.md](references/patterns.md) for more advanced patterns and anti-bot techniques.

