# Web Scraping

> Web Scraping is an Agent Skill for research published in the mofa-org/mofa repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Extract data from web pages, including HTML parsing, API interaction, and data export

- Skill name: `web_scraping`
- Category: [Research](https://www.openparable.com/skill/research/1)
- Source: https://github.com/mofa-org/mofa/blob/HEAD/examples/skills/web_scraping/SKILL.md
- Repository: mofa-org/mofa (290 GitHub stars when collected)

## SKILL.md

# Web Scraping Skill

This skill enables web scraping and data extraction capabilities.

## When to Use

Use this skill when you need to:
- Scrape data from websites
- Interact with REST APIs
- Parse HTML content
- Export scraped data to various formats

## Scraping Methods

### Static HTML Scraping
For static websites, use CSS selectors to extract data.

### Dynamic Content
For JavaScript-heavy sites, use browser automation.

### API Access
For structured data access, prefer REST or GraphQL APIs.

## Code Tools

This skill includes:
- @code: python scraper.py --input {input} - Generic web scraper
- @code: bash fetch.sh {url} - Simple HTTP fetcher

## Best Practices

1. **Check robots.txt**: Always respect site scraping policies
2. **Rate limiting**: Add delays between requests to avoid overwhelming servers
3. **User-Agent**: Identify your bot properly
4. **Error handling**: Gracefully handle network errors and timeouts

## Example

To scrape a webpage:
```
Use the web_scraping skill to extract product information from https://example.com/products
```

---

Source: https://www.openparable.com/skill/research/web-scraping-6668c701 (OpenParable). Cite the canonical URL above.
