Scrape Any
Scrape any website to clean Markdown, CSV or JSON: fast HTTP first, stealth browser fallback for JavaScript or bot-protected pages, site crawls, contact details and Wayback Machine copies. Runs locally, respects robots.txt.
Documentation
scrape-any
Scrape any website, for people and for AI agents. One command (or one function, or one MCP tool) that reads a page the way a person sees it. It uses fast HTTP when that's enough and switches to a stealth browser automatically when the site blocks bots, hides content behind JavaScript, or puts up a Cloudflare challenge. It can also read any page as it was in the past from the Wayback Machine.
scrape-any example.com # everything on the page, as JSON
scrape-any https://blog.example.com/post -F md # the article as clean Markdown
Built on Scrapling (fetchers, stealth browser, Cloudflare solver). scrape-any adds the parts you normally write yourself every time: picking a mode, extraction, pagination, crawling, sitemaps, contacts, web archives, dedupe, limits, reports, output formats and an MCP server.
What it does
| You want | Command |
|---|---|
| Everything on a page (title, meta, headings, text, links, images, tables, JSON-LD, emails, phones, socials) | scrape-any URL |
| The main content as clean Markdown, without menus or footers | scrape-any URL -F md |
| A product / listing / table page as rows | scrape-any URL --item ".card" --field name=h2 --field price=.price -F csv |
| Follow "next page" | ... --next "a.next" --max-pages 50 |
| A whole site | scrape-any URL --crawl --max-pages 500 -F jsonl -o site.jsonl |
| Only what's in the sitemap | scrape-any URL --sitemap --include "/blog/" |
A site for an LLM (llms.txt + llms-full.txt) | scrape-any URL --crawl -F llms -o pack/ |
| Emails, phones and social profiles for a list of sites | scrape-any -f sites.txt --contacts -F csv -o leads.csv |
| New businesses this week from city licence data (Chicago, NYC, LA, SF, Seattle…), flagged when they have no website | scrape-any --licenses chicago --since 7d --license-type restaurant --licenses-enrich -F csv |
| Google Maps leads: name, phone, website, rating, reviews, hours, address, coordinates (+ website emails) | scrape-any --maps "dentists in Lahore" --maps-max 50 --maps-emails -F csv -o dentists.csv |
| The data a web app loads in the background (XHR / fetch / GraphQL JSON) | scrape-any URL --capture-api --api-filter "/api/" |
| A full-page screenshot | scrape-any URL --screenshot shots/ |
| Pages behind your login | scrape-any URL --profile ~/.scrape-any/site --show-browser (log in once, reused after) |
| A page as it was in 2015 | scrape-any URL --wayback 2015 |
| Every saved version of a page | scrape-any URL --wayback-list --from 2010 -F csv |
| Every archived URL of a dead site | scrape-any oldsite.com --wayback-urls -F csv |
| Rebuild a deleted site as Markdown | scrape-any oldsite.com --wayback 2018 --crawl -F llms -o pack/ |
How it gets past blocks
--mode auto (the default) runs this ladder for each URL:
- Fast HTTP with a real Chrome TLS fingerprint and realistic headers (no browser, about 1 second).
- If the response is a bot wall (403/429/503, Cloudflare, PerimeterX, DataDome, Incapsula, AWS WAF,
captcha markers), an empty JavaScript shell (React/Next/Vue app with no text), or your
--item/--selectmatched nothing, it switches to a stealth Chromium browser. - If the browser lands on a Cloudflare challenge, it retries with the challenge solver on.
- If it is still blocked, the run report says so (
blocked: 1, with the reason) instead of giving you a silent empty result.
Measured on 2026-11-29: scrapingcourse.com/cloudflare-challenge answered HTTP 403 to step 1, and
step 3 returned "You bypassed the Cloudflare challenge!". A JavaScript-only page
(quotes.toscrape.com/js/) returned 0 rows over HTTP and 10 rows after the automatic switch.
Honest limits. No scraper gets through every block on every site. Hard targets may also need a
residential --proxy, --real-chrome, or a logged-in --profile. Captchas that need a human
(image puzzles) are not solved. Speed: the browser is about 5–10× slower than HTTP, which is why it
is only used when needed.
Install
pip install "scrape-any[mcp]" # or: uv tool install "scrape-any[mcp]"
scrapling install # one time: downloads the stealth browser (~200 MB)
From source:
git clone https://github.com/alaudinbarki/scrape-any && cd scrape-any
uv venv && uv pip install -e ".[dev]" && scrapling install
Python 3.12+. Docker: docker build -t scrape-any . && docker run --rm scrape-any example.com.
Use it from the command line
# Product listing -> CSV, with pagination, a regex-cleaned price and absolute links
scrape-any https://shop.example.com/c/tools \
--item ".product" \
--field name=h2 \
--field price=".price|re:[\d.,]+" \
--field url="a::attr(href)" \
--field image="img::attr(src)" \
--next "a.next" --max-pages 30 \
-F csv -o tools.csv --report run.json
# Infinite-scroll page: browser, scroll 10 times, wait for results
scrape-any https://app.example.com/feed --mode browser --scroll 10 --wait ".post"
# Same options from a file (good for repeat jobs)
scrape-any --config examples/job-quotes.json
Selectors
| Form | Example | Returns |
|---|---|---|
| CSS element | h2, .price | the element's visible text |
| CSS text | h1::text | the text node |
| CSS attribute | a::attr(href), img::attr(src) | the attribute (links made absolute when the field name looks like url, link, image…) |
| XPath | //h2/text(), xpath://span[@class='p'] | the XPath result |
| Regex filter | .price|re:[\d.]+, .sku|re:SKU-(\d+) | the first match, or group 1 |
Output formats (-F)
| Format | Notes |
|---|---|
json (default) | one object for one page, a list otherwise |
jsonl | one row per line, streamed while the run goes (safe for big crawls) |
csv | lists joined with ; , heavy fields (text, links, tables) replaced by counts |
md | page rows as Markdown; -o dir/ writes one .md per page |
text | plain text (pages) or tab-separated values (rows) |
llms | llms.txt (site map, llmstxt.org format) + llms-full.txt (all pages) |
Every run ends with a report
[scrape-any] done: 2 page(s) ok, 4 row(s), 1 duplicate(s) dropped, price empty in 1/4
--report run.json saves the full report: pages ok/failed/blocked with reasons, rows,
duplicates, whether --max-items stopped the run, the fill rate of each field, and how many requests
went over HTTP and how many through the browser.
Exit codes: 0 all good · 1 nothing could be read · 2 bad options · 3 some pages failed or were blocked.
Run scrape-any --help for every option.
Use it from Python
from scrape_any import scrape
page = scrape("https://example.com")[0]
print(page["title"], page["emails"], page["socials"])
rows, report = scrape(
"https://quotes.toscrape.com",
item=".quote",
fields={"text": ".text", "author": ".author", "tags": ".tags"},
next_sel="li.next a",
max_pages=5,
report=True,
)
print(len(rows), report.summary())
old = scrape("https://example.com", wayback="2005", markdown=True)[0]
print(old["snapshot_time"], old["markdown"][:200])
Use it from an AI agent (MCP)
scrape-any-mcp is an MCP server (stdio). Add it to Claude Code,
Claude Desktop, Cursor or any MCP client:
{
"mcpServers": {
"scrape-any": { "command": "scrape-any-mcp" }
}
}
Claude Code: claude mcp add scrape-any -- scrape-any-mcp
Try it before installing: scrape-any is listed on Glama, where you can browse its tools, check its quality score and test it online with the MCP Inspector.
Prefer a skill instead of MCP? skills/scrape-any/ is a ready SKILL.md package (Claude
Code, Codex, Cursor and other agents that read SKILL.md): copy the folder into your agent's skills directory.
In Claude Code you can install it as a plugin in one step:
/plugin install scrape-any --marketplace alaudinbarki/scrape-any
| Tool | What the agent gets |
|---|---|
scrape_page | a page as Markdown (or full JSON), with automatic switching to the browser |
extract_items | repeated records as JSON rows, with pagination |
crawl_site | many pages of a site (links or sitemap) with Markdown excerpts |
find_contacts | emails, phones and socials per site |
business_licenses | new businesses from a city licence feed, optionally checked on Google Maps; new_only for daily calls |
google_maps | businesses for a Maps search, optionally with website emails |
capture_api | the JSON responses a web app loads |
screenshot | a full-page image |
wayback_page | a page as archived on a date |
wayback_snapshots | every saved version of a page |
wayback_site_urls | every archived URL of a domain |
Every tool wraps scraped content in a notice that it is untrusted data, not instructions, because a web page can carry text written to hijack an agent (prompt injection).
New-business leads from city licence data
Cities publish every new business licence as open data, usually within days. That is the earliest public sign a business exists, often before it has a website or a Google listing. Being first in the door with "you need a website / Google profile" beats every agency that waits for them to show up on Maps.
scrape-any --licenses list # supported cities
scrape-any --licenses chicago --since 7d -F csv -o chicago.csv # everything new this week
scrape-any --licenses chicago,nyc --since 14d --license-type restaurant --license-type salon -F csv
scrape-any --licenses chicago --since 3d --licenses-enrich -F csv -o hot.csv # + Google Maps check
scrape-any --licenses data.example.gov/abcd-1234 --date-field issue_date # any Socrata portal
| City | Feed | Notes |
|---|---|---|
chicago | data.cityofchicago.org/r5kz-chrr | new licences only; ~15 a day |
nyc | data.cityofnewyork.us/w7w3-xahh | DCWP licences, includes phone; lags ~1 week, use --since 14d |
los-angeles | data.lacity.org/6rrh-rzua | business tax registrations |
san-francisco | data.sf.gov/g8m3-pdis | open locations in the city; category usually blank |
seattle | cos-data.seattle.gov/wnbq-64tb | includes phone; some businesses are outside Seattle |
new-orleans | data.nola.gov/hjcd-grvu | includes phone |
norfolk, everett | data.norfolk.gov, data.everettwa.gov | smaller cities |
calgary, edmonton | data.calgary.ca, data.edmonton.ca | Canada |
Every city comes out in the same shape: name, legal_name, category, address, city, state, zip, country, phone, start_date, license_id, latitude, longitude, source, dataset_url.
--licenses-enrich looks each business up on Google Maps (strip unit numbers, search, check up to 3
results) and accepts a place only when at least half the licence name's words match and the street
number matches, so neither a previous tenant at the address nor another branch of a chain is mistaken
for it. It adds lead_status and a google_note explaining the decision:
lead_status | Means | Pitch |
|---|---|---|
not_on_google | Google answered and no result is this business at this address | hottest: no web presence at all |
no_website | listed on Google, no website | hot: "you need a site" |
has_website | has a site | lower priority (SEO, ads) |
lookup_failed | Google could not be read (block, limited view, slow load); never counted as not_on_google | run again later |
…plus maps_name, website, rating, reviews_count, maps_url, maps_match, and the Maps phone when the
licence had none. Measured 2026-11-30 on three known cases: a new Pazza Pizza branch → not_on_google (note: same name at
the Taylor St location), Lou Malnati's at 439 N Wells → has_website, an invented bakery → not_on_google. NYC home-improvement, 14 days: phones on the
licence itself.
The licence data is public open data read through the official Socrata API (no key; set nothing). The
--licenses-enrich step uses Google Maps, so the Maps warning below applies to it.
Daily runs: only what's new (--new-only)
Add --new-only to any command and it outputs only rows that no earlier run of the same job delivered.
The first run outputs everything and remembers it; every later run gives just the new ones.
scrape-any --licenses chicago --since 3d --new-only -F csv -o "new-$(date +%F).csv"
scrape-any --maps "dentists in Lahore" --maps-max 100 --new-only -F csv -o new-dentists.csv
scrape-any https://shop.example.com/c --item .product --field name=h2 --field url="a::attr(href)" --new-only
- What counts as "the same row": a licence is its city + name + address, a Maps place its place ID, a page its URL, an item all of its fields (so a price change shows up as new), a contacts row its site.
- Memory:
~/.scrape-any/state/<job>.json, one file per job (city, types, mode; not--sinceor limits, so a daily--since 3dwindow can overlap safely).--state FILEpicks the file,--reset-stateforgets,SCRAPE_ANY_STATE_DIRmoves the folder. Keys older than 180 days expire. - Safe: rows are remembered only after the output file was written, so a crash or a full disk never loses a lead. Already-delivered licences and places skip the slow Google Maps / website lookups.
- The summary says
first --new-only run…orN already delivered before (skipped); zero new rows is still exit code 0.
Every morning, automatically with examples/daily-leads.sh (one CSV per day in ~/leads, later runs
the same day append, days with nothing new leave no file):
CITIES=chicago,nyc TYPES="restaurant,salon" SINCE=3d ENRICH=1 examples/daily-leads.sh
# macOS: install the 06:00 schedule (edit CITIES etc. in the plist first)
sed "s#__SCRIPT__#$PWD/examples/daily-leads.sh#; s#__HOME__#$HOME#g" examples/com.scrape-any.daily-leads.plist \
> ~/Library/LaunchAgents/com.scrape-any.daily-leads.plist
launchctl load ~/Library/LaunchAgents/com.scrape-any.daily-leads.plist
# Linux cron
0 6 * * * CITIES=chicago /path/to/examples/daily-leads.sh >> ~/leads/cron.log 2>&1
Google Maps
scrape-any --maps "dentists in Lahore" --maps-max 50 --maps-emails -F csv -o dentists.csv
scrape-any --maps "cafes in Berlin" "bakeries in Berlin" -F jsonl -o berlin.jsonl
scrape-any --maps "https://www.google.com/maps/place/..." # one known place
One row per business: name, category, categories, address, phone, website, rating, reviews_count, price_range, status, description, hours, latitude, longitude, plus_code, timezone, place_id, data_id, thumbnail, reviews_url, maps_url, plus emails and socials with --maps-emails (read from each
business's own website, checking up to 3 contact/about pages). Places are deduped by Google's place ID.
It opens the search in the stealth browser, scrolls the results list, then reads each place's own data
record (APP_INITIALIZATION_STATE) instead of page CSS, which changes often. The record's field
positions are ported from gosom/google-maps-scraper (MIT).
Measured 2026-11-29: "cafes in Islamabad", 8 places in 40 s, every row with a phone and rating.
"dentists in Lahore" with --maps-emails: emails found for 3 of 4 clinics.
Read this first. Google's robots.txt disallows
/maps/and Google's Terms of Service forbid automated access. Maps mode ignores robots.txt for google.com and prints a notice on every run. Use it at your own risk, keep volumes low, and expect CAPTCHAs or blocks at scale (a residential--proxylowers that risk but does not remove it). Business contact data can still be personal data under GDPR and similar laws.
Web archives
| Source | Support |
|---|---|
| Wayback Machine (web.archive.org) | Full. Snapshots are read in raw id_ mode (the original HTML, no toolbar, links not rewritten), so --item, --crawl, --contacts, -F md/llms all behave as on the live site, and every row keeps the original URL plus snapshot_url and snapshot_time. Lists come from the CDX API. |
| archive.today (archive.ph) | Best effort (--archive-today). It has no public API and often shows a captcha, so it is opened in the stealth browser. Not verified from the author's network (archive.ph timed out there on 2026-11-29). |
--wayback WHEN takes latest (default), earliest, 2019, 2019-05, 2019-05-01 or a full
20190501123000. A bare year or month aims at its middle, so the closest capture lands inside it.
Archive mode never contacts the live site, so it skips the live site's robots.txt.
Responsible use
- robots.txt is checked by default and its
Crawl-delayis honoured.--ignore-robotsexists for sites you own or have permission to scrape. - The default
--delay 1keeps the load polite.--max-itemsis a hard cap. - You are responsible for following each site's terms, copyright, and privacy law (GDPR, CCPA) for any personal data you collect, such as emails and phones.
- Don't use it to get around paywalls or logins you have no right to.
Development
uv venv && uv pip install -e ".[dev]"
pytest -q # 54 tests, offline: they use a local test website in tests/fixtures/site
ruff check src tests && ruff format --check src tests
Design docs live in docs/ (product, technical, flow, design, schema, plan). See
CONTRIBUTING.md and SECURITY.md.
License
MIT. Scrapling, the engine under this tool, is BSD-3-Clause.