Logo Web Scrape

Web Scrape

Cộng đồng
Barrios88
web-scrape

Web scraping skill for economists and applied researchers. Use this skill whenever the user wants to extract data from websites, scrape tables, download PDFs, access paywalled academic journals (JSTOR, ScienceDirect, Elsevier, NBER, SSRN, AER, etc.), bulk-download papers, scrape government data, hit REST APIs, or build reusable scraping scripts. Triggers on: "scrape", "download PDF", "get data from", "pull from website", "extract table", "journal article", "paywall", "curl", "Playwright", "bulk download", "DOI download", or any request to collect data from an external URL. Always use this skill — even for seemingly simple scrape tasks — because tool selection (curl vs. curl_yale vs. browserless vs. Playwright) matters enormously and the wrong choice silently fails.

Add to TypingMind

Tổng quan

Nhà phát hànhBarrios88
Kho mãbarrios-skills
Tên kỹ năngweb-scrape
Sao
64
Bản fork
30
Tệp đi kèm
3
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Barrios88 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Web Scrape trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Barrios88/barrios-skills/tree/main/skills/research-tools/web-scrape
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Barrios88/barrios-skills.git /tmp/barrios-skills
mkdir -p .claude/skills
cp -r /tmp/barrios-skills/skills/research-tools/web-scrape .claude/skills/web-scrape
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Web Scrape trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Web Scrape ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Web Scrape với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Barrios Skills — John Barrios's curated workflow for economists and accountants. Prioritize reproducible empirical work, clear identification language, and journal-ready output.

Web Scraping — Economist's Toolkit

Guiding principle: escalate only as needed

Start simple, escalate when blocked. The tiers:

curl / curl_chrome142   →  fastest, works for most static pages and APIs
curl_yale               →  add Yale IP for paywalled journals + PDFs
url-scrape / url-content→  add JS rendering (browserless) for SPAs and dynamic tables
Playwright via WS       →  full browser for login flows, pagination, complex interactions

Never jump to Playwright when curl_chrome142 will do. The escalation cost is real: each tier is slower and more complex.


Quick decision table

TargetTool
Open static page or government datacurl_chrome142
REST API / JSON endpointcurl
JSTOR, ScienceDirect, Elsevier, AER, any paywallcurl_yale
PDF via DOI redirectcurl_yale -sfL -o file.pdf
NBER, SSRN (usually open, sometimes gated)try curl_chrome142 first, then curl_yale
Table that renders via JavaScripturl-scrape -s 'table' or url-content
SPA / React appurl-content -w '.main-selector'
Login flow, multi-page pagination, form submissionPlaywright via WebSocket
Bulk download: list of DOIs / URLsloop + curl_yale (see patterns below)

Tool reference

curl_chrome142 — bot-resistant scraping (no paywall)

Uses curl-impersonate: real Chrome 142 TLS fingerprint, defeats most Cloudflare/Akamai blocks.

bash
# Scrape page text
curl_chrome142 -sf https://example.com | htmlq 'article' --text

# Extract all links
curl_chrome142 -sf https://example.com | htmlq 'a' --attribute href

# Hit a JSON API
curl -sf 'https://api.bls.gov/publicAPI/v2/timeseries/data/' | jq '.Results.series[0].data'

# Download a file
curl_chrome142 -sfL -o paper.pdf https://example.com/paper.pdf

curl_yale — paywalled journal access

Routes through a SOCKS5 proxy on the Yale network. Requires the proxy to be running — see setup-yale.md if curl_yale is unavailable or times out.

bash
# Download a JSTOR article as HTML
curl_yale -sfL 'https://www.jstor.org/stable/10.2307/1234567' -o article.html

# Download a PDF via DOI (follows redirects to publisher PDF)
curl_yale -sfL 'https://doi.org/10.1257/aer.20150154' -o paper.pdf

# Scrape article metadata from ScienceDirect
curl_yale -sf 'https://www.sciencedirect.com/science/article/pii/S0304405X19301234' | htmlq 'meta[name="citation_title"]' --attribute content

# Verify your Yale IP is active
curl_yale -sf https://httpbin.org/ip | jq .

url-scrape — extract specific elements from JS-rendered pages

Returns JSON with text + HTML for each matched CSS selector. Use when the page requires JavaScript to render (inspect page source: if the data isn't there, it's JS-rendered).

bash
# Scrape a dynamic table
url-scrape -s 'table' https://example.com/data | jq '.data[0].results[].html'

# Multiple selectors
url-scrape -s 'h1' -s '.abstract' -s 'table.results' https://journal.com/article

# Wait for content to load, skip images for speed
url-scrape -s '.data-table' -w '.data-table' -r image,stylesheet,font https://spa-app.com

# Save output
url-scrape -s 'table' https://example.com ./tmp/scraped.json

# Extract just the text from results
url-scrape -s 'p.abstract' https://example.com | jq '.data[0].results[].text'

url-content — get full rendered HTML

Use when you need the whole page after JS runs, then pipe to htmlq/pup.

bash
# Get full rendered HTML, extract article
url-content https://example.com | htmlq 'article' --text

# Wait for SPA content
url-content -w '.main-content' -r image,stylesheet,font https://spa-site.com | htmlq 'table'

# Save page for inspection
url-content https://example.com > ./tmp/page.html

Playwright via WebSocket — full browser control

For multi-step scraping only: login flows, pagination clicking, form interaction. See playwright-patterns.md for complete examples.

bash
# Quick template — Python (preferred for data work)
uv run --with playwright python3 -c "
import json, urllib.parse
from playwright.sync_api import sync_playwright

token = '$BROWSERLESS_TOKEN'
host = '$BROWSERLESS_HOST'
launch = urllib.parse.quote(json.dumps({'stealth': True, 'args': ['--disable-blink-features=AutomationControlled']}))
ws = f'wss://{host}/chromium/playwright?token={token}&launch={launch}'

with sync_playwright() as p:
    browser = p.chromium.connect(ws)
    page = browser.new_page()
    page.goto('https://example.com')
    # your logic here
    print(page.content())
    browser.close()
"

Economist patterns

Download a batch of PDFs by DOI

bash
# dois.txt — one DOI per line
while IFS= read -r doi; do
    filename=$(echo "$doi" | tr '/' '_').pdf
    echo "Downloading: $doi → $filename"
    curl_yale -sfL "https://doi.org/${doi}" -o "${OUTPUT_DIR}/${filename}" || echo "FAILED: $doi"
    sleep 1  # be polite
done < dois.txt

Scrape an HTML table to CSV (Python)

bash
python3 -c "
import subprocess, sys
html = subprocess.check_output(['curl_chrome142', '-sf', sys.argv[1]]).decode()
import re
from html.parser import HTMLParser
# Simple: pipe through pandas
" URL

# OR: use pandas directly
python3 -c "
import pandas as pd
tables = pd.read_html('URL')
tables[0].to_csv('data.csv', index=False)
print(f'Found {len(tables)} tables, saved first as data.csv')
"

# For JS-rendered tables:
url-scrape -s 'table' https://example.com | python3 -c "
import json, sys
data = json.load(sys.stdin)
html = data['data'][0]['results'][0]['html']
import pandas as pd, io
df = pd.read_html(io.StringIO(html))[0]
df.to_csv('table.csv', index=False)
print(df.head())
"

Scrape paginated data (static pagination)

bash
# Loop over page numbers
for page in $(seq 1 20); do
    curl_chrome142 -sf "https://example.com/data?page=${page}" | htmlq '.result-item' --text >> results.txt
    sleep 0.5
done

NBER working papers bulk download

bash
# Get paper list for a topic, then download PDFs
curl_chrome142 -sf 'https://www.nber.org/search?q=labor+supply&searchType=Public' | \
  htmlq 'a[href*="/papers/"]' --attribute href | \
  sed 's|/papers/||' | \
  while read paper_id; do
    curl_chrome142 -sfL "https://www.nber.org/papers/${paper_id}.pdf" -o "nber_${paper_id}.pdf"
    sleep 1
  done

SSRN download by paper ID

bash
curl_chrome142 -sfL "https://papers.ssrn.com/sol3/Delivery.cfm/DELIVERY_ID?abstractid=PAPER_ID&type=2" -o paper.pdf
# If blocked: try curl_yale instead

Output format guidance

For analysis (Stata, R, Python): Save scraped tables as CSV. Use pandas.read_html() for HTML tables, or parse JSON from url-scrape → CSV.

For inspection first: Save raw HTML/JSON, then extract. Good for debugging when you're unsure what's on the page.

For bulk PDF datasets: Organize as author_year_keyword.pdf or by DOI slug. Always log successes/failures to a text file when batch downloading.

When choosing output format:

  • Data that looks like a table → CSV
  • Metadata, structured records → JSON or CSV depending on complexity
  • Full article text → plain text or Markdown

Troubleshooting

curl_yale hangs / times out → SOCKS5 proxy not running. See setup-yale.md.

Getting 403 / bot detection → Try curl_yale (adds Yale IP + Chrome fingerprint). If still blocked, escalate to url-scrape / url-content.

Content not in HTML (JS-rendered) → Use url-content or url-scrape. Tip: compare curl_chrome142 -sf URL | htmlq 'body' --text vs. what you see in browser — if they differ, it's JS-rendered.

url-scrape returns empty → Add -w 'SELECTOR' -t 5000 to wait longer for dynamic content.

PDF is HTML (access denied page) → curl_yale not routing through Yale IP. Check proxy. Run curl_yale -sf https://httpbin.org/ip | jq . to verify.

Need help with setup → See setup-general.md for curl-impersonate + htmlq/pup/jq install, and setup-yale.md for the Yale proxy + browserless.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Web Scrape làm được gì?

Web scraping skill for economists and applied researchers. Use this skill whenever the user wants to extract data from websites, scrape tables, download PDFs, access paywalled academic journals (JSTOR, ScienceDirect, Elsevier, NBER, SSRN, AER, etc.), bulk-download papers, scrape government data, hit REST APIs, or build reusable scraping scripts. Triggers on: "scrape", "download PDF", "get data from", "pull from website", "extract table", "journal article", "paywall", "curl", "Playwright", "bulk download", "DOI download", or any request to collect data from an external URL. Always use this s...

Vì sao nên dùng Web Scrape trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Web Scrape là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Web Scrape trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Barrios88/barrios-skills/tree/main/skills/research-tools/web-scrape. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Web Scrape?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Web Scrape với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Web Scrape với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Web Scrape có miễn phí không?

Có. Kỹ năng này được Barrios88 phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇