Skip to content
Back to skills

Polite

ASecurity

R polite package for ethical web scraping. Use for respecting robots.txt and rate limiting.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 5, 2026
dataapi

Works with

  • api

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill polite --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polite?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polite
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-polite/badge)](https://www.skillsdirectory.com/skills/leolin990405-polite)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: polite
description: R polite package for ethical web scraping. Use for respecting robots.txt and rate limiting.
---

# polite Package

Ethical web scraping with robots.txt compliance.

## Basic Usage

```r
library(polite)
library(rvest)

# Bow (introduce yourself)
session <- bow("https://example.com",
  user_agent = "MyBot (contact@example.com)"
)

# Check permissions
session

# Scrape (politely)
page <- scrape(session)
```

## Rate Limiting

```r
# Automatic delay between requests
session <- bow("https://example.com",
  delay = 5  # 5 seconds between requests
)

# Scrape multiple pages
urls <- c("/page1", "/page2", "/page3")

results <- lapply(urls, function(path) {
  session %>%
    nod(path) %>%
    scrape()
})
```

## Navigate

```r
# Initial bow
session <- bow("https://example.com")

# Navigate to subpages
page1 <- session %>% nod("/products") %>% scrape()
page2 <- session %>% nod("/about") %>% scrape()
```

## Check robots.txt

```r
# See what's allowed
session <- bow("https://example.com")
session$robotstxt

# Check specific path
session$robotstxt$check("/api/")
```

## With rvest

```r
library(polite)
library(rvest)

session <- bow("https://example.com")

# Scrape and extract
data <- session %>%
  scrape() %>%
  html_elements(".item") %>%
  html_text()

# Multiple pages
pages <- paste0("/page/", 1:10)

all_data <- lapply(pages, function(p) {
  Sys.sleep(1)  # Extra politeness
  session %>%
    nod(p) %>%
    scrape() %>%
    html_table()
})
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.