The arakun command
Fetch web pages
Read a web page or a whole site as Markdown with arakun fetch and arakun crawl, loaded in a real browser on Cloudflare Browser Run.
On this page
Some pages need JavaScript to show anything. arakun fetch and arakun crawl load them in Cloudflare Browser Run, a real browser on Cloudflare's network, and give back Markdown an agent can read.
They work without a running Arakun.
#Set up a token
Create a Cloudflare API token
Give it the Browser Run - Edit permission. The
cfsign-in doesn't carry it.Store it with its account
sharakun fetch --set-token <account-id> < token.txtThe token is read from stdin and kept in the system keyring.
Or set CLOUDFLARE_BROWSER_RUN_TOKEN and CLOUDFLARE_ACCOUNT_ID instead.
#Fetch a page
arakun fetch https://example.com # the page as Markdown
arakun fetch --html https://example.com # the rendered HTML
arakun fetch --links https://example.com # the links on the page#Crawl a site
arakun crawl --limit 50 --depth 2 https://example.com/docsThis prints the site's pages as Markdown, one after another, as they are read.
--limit N
The maximum number of pages to read. The default is 20.
--depth N
How many links deep to go from the first page.
--render
Run each page's JavaScript before reading it.
--include <glob>
Read only pages whose address matches. Repeat it for more patterns.
--exclude <glob>
Skip pages whose address matches. Repeat it for more patterns.
A crawl gives up after 30 minutes.
#Limits
- What you can fetch depends on your Workers plan. On a rate limit, Arakun waits and tries again a few times.
- It does not get past captchas.
arakun crawlhonorsrobots.txtand Content Signals.
Did this page help?
Tell us about a mistake on this page, or ask for help with Arakun.