/file-download
Download files from websites, save PDFs, and read downloaded content. Trigger when the user asks to: download a file, save a PDF, export a document, fetch a file from a URL, grab a report, download and read a PDF, or save page content as a file.
$ npx -y skills add billy-enrizky/openbrowser-ai --skill file-download --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/file-download
Context preview
The summary Claude sees to decide when to auto-load this skill.
Download files from websites, save PDFs, and read downloaded content. Trigger when the user asks to: download a file, save a PDF, export a document, fetch a file from a URL, grab a report, download and read a PDF, or save page content as a file.
SKILL.md
file-download.SKILL.mdname: file-download
description: |
Download files from websites, save PDFs, and read downloaded content.
Trigger when the user asks to: download a file, save a PDF, export a document,
fetch a file from a URL, grab a report, download and read a PDF, or save page content as a file.
allowed-tools: Bash(openbrowser-ai:*) Bash(curl:*) Bash(uv:*) Bash(irm:*) Read Write
File Download
Download files from websites using the browser's authenticated session. Handles PDFs, CSVs, images, and any downloadable content. Preserves cookies and login sessions for authenticated downloads.
All code runs via `openbrowser-ai -c`. The daemon starts automatically and persists variables across calls. All browser functions are async -- use `await`.
The CLI daemon also persists cookies and login state in `~/.config/openbrowser/profiles/daemon/storage_state.json`, so authenticated sessions can be reused across later runs.
Setup
Before running, verify openbrowser-ai is installed:
openbrowser-ai --help
If not found, install:
# macOS/Linux
curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex
Workflow
Step 1 -- Navigate and find download links
openbrowser-ai -c - <<'EOF'
await navigate("https://example.com/reports")
# Get browser state to find clickable download links
state = await browser.get_browser_state_summary()
for idx, el in state.dom_state.selector_map.items():
text = el.get_all_children_text(max_depth=1)
if "download" in text.lower() or "pdf" in text.lower() or "export" in text.lower():
print(f"[{idx}] {el.tag_name}: {text}")
EOFStep 2 -- Download a file by URL
Use `download_file()` to download directly. This uses the browser's JavaScript `fetch` internally, preserving cookies and authentication:
openbrowser-ai -c - <<'EOF'
path = await download_file("https://example.com/reports/annual-report.pdf")
print(f"Saved to: {path}")
EOFWith a custom filename:
openbrowser-ai -c - <<'EOF'
path = await download_file(
"https://example.com/api/export?format=csv",
filename="sales-data.csv"
)
print(f"Saved to: {path}")
EOFStep 3 -- Extract a download URL from the page
When the download URL is not directly visible, extract it from a link or button:
openbrowser-ai -c - <<'EOF'
# Extract href from a download link
download_url = await evaluate("""
(function(){
const link = document.querySelector("a[href$=\".pdf\"]");
return link ? link.href : null;
})()
""")
if download_url:
path = await download_file(download_url)
print(f"Downloaded: {path}")
else:
print("No PDF link found")
EOFStep 4 -- Read a downloaded PDF
After downloading, use `pypdf` to extract text (requires `pip install openbrowser-ai[pdf]`):
openbrowser-ai -c - <<'EOF'
from pypdf import PdfReader
reader = PdfReader(path)
print(f"Pages: {len(reader.pages)}")
# Extract text from all pages
for i, page in enumerate(reader.pages):
text = page.extract_text()
print(f"--- Page {i+1} ---")
print(text[:500])
EOFStep 5 -- Read other file types
openbrowser-ai -c - <<'EOF'
from pathlib import Path
file_path = Path(path)
# CSV
if file_path.suffix == ".csv":
import pandas as pd
df = pd.read_csv(file_path)
print(df.to_string())
# JSON
if file_path.suffix == ".json":
import json
data = json.loads(file_path.read_text())
print(json.dumps(data, indent=2))
# Plain text
if file_path.suffix in (".txt", ".md", ".log"):
print(file_path.read_text())
EOFStep 6 -- Download multiple files
openbrowser-ai -c - <<'EOF'
urls = [
"https://example.com/report-q1.pdf",
"https://example.com/report-q2.pdf",
"https://example.com/report-q3.pdf",
]
paths = []
for url in urls:
path = await download_file(url)
paths.append(path)
print(f"Downloaded: {path}")
print(f"Total files: {len(paths)}")
EOFStep 7 -- List all downloads
openbrowser-ai -c - <<'EOF'
files = list_downloads()
for f in files:
print(f)
print(f"Total: {len(files)} files")
EOFStep 8 -- Download from authenticated pages
`download_file()` preserves the browser's login session. Log in first, then download:
openbrowser-ai -c - <<'EOF'
# Navigate and log in
await navigate("https://portal.example.com/login")
await input_text(username_index, "user@example.com")
await input_text(password_index, "password")
await click(login_button_index)
await wait(2)
# Now download an authenticated resource
path = await download_file("https://portal.example.com/api/reports/confidential.pdf")
print(f"Downloaded: {path}")
EOFTips
- Code is piped via stdin using heredoc (`-c - <<'EOF'`), so all Python syntax works without shell escaping issues.
- Use `download_file(url)` instead of `navigate(url)` for files. `navigate()` opens PDFs in the browser viewer but does not save them.
- `download_file()` preserves cookies and authentication -- no need to re-authenticate.
- Filename conflicts are handled automatically with `(N)` suffix (e.g., `report (1).pdf`).
- If no filename is provided, it is derived from the URL path.
- Use `list_downloads()` to see all files saved in the downloads directory.
- For large files, `download_file()` has a 120-second timeout.
- The fallback strategy uses Python `requests` if the browser fetch fails (e.g., CORS restrictions), but without browser cookies.
Cleanup
This step is **mandatory**. Run it after every download run, whether the file landed successfully or the request failed. Without it, the daemon keeps Chrome running until its 10-minute idle timeout, leaving a stale browser process, a locked profile, and (on macOS/Linux desktop) a visible window.
Stop the daemon, then verify it is gone:
openbrowser-ai daemon stop
openbrowser-ai daemon
Read more
name: file-download description: | Download files from websites, save PDFs, and read downloaded content. Trigger when the user asks to: download a file, save a PDF, export a document, fetch a file from a URL, grab a report, download and read a PDF, or save page content as a file. allowed-tools: Bash(openbrowser-ai:*) Bash(curl:*) Bash(uv:*) Bash(irm:*) Read Write
File Download
Download files from websites using the browser's authenticated session. Handles PDFs, CSVs, images, and any downloadable content. Preserves cookies and login sessions for authenticated downloads.
All code runs via `openbrowser-ai -c`. The daemon starts automatically and persists variables across calls. All browser functions are async -- use `await`.
The CLI daemon also persists cookies and login state in `~/.config/openbrowser/profiles/daemon/storage_state.json`, so authenticated sessions can be reused across later runs.
Setup
Before running, verify openbrowser-ai is installed:
openbrowser-ai --help
If not found, install:
# macOS/Linux curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh # Windows (PowerShell) irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex
Workflow
Step 1 -- Navigate and find download links
openbrowser-ai -c - <<'EOF'
await navigate("https://example.com/reports")
# Get browser state to find clickable download links
state = await browser.get_browser_state_summary()
for idx, el in state.dom_state.selector_map.items():
text = el.get_all_children_text(max_depth=1)
if "download" in text.lower() or "pdf" in text.lower() or "export" in text.lower():
print(f"[{idx}] {el.tag_name}: {text}")
EOFStep 2 -- Download a file by URL
Use `download_file()` to download directly. This uses the browser's JavaScript `fetch` internally, preserving cookies and authentication:
openbrowser-ai -c - <<'EOF'
path = await download_file("https://example.com/reports/annual-report.pdf")
print(f"Saved to: {path}")
EOFWith a custom filename:
openbrowser-ai -c - <<'EOF'
path = await download_file(
"https://example.com/api/export?format=csv",
filename="sales-data.csv"
)
print(f"Saved to: {path}")
EOFStep 3 -- Extract a download URL from the page
When the download URL is not directly visible, extract it from a link or button:
openbrowser-ai -c - <<'EOF'
# Extract href from a download link
download_url = await evaluate("""
(function(){
const link = document.querySelector("a[href$=\".pdf\"]");
return link ? link.href : null;
})()
""")
if download_url:
path = await download_file(download_url)
print(f"Downloaded: {path}")
else:
print("No PDF link found")
EOFStep 4 -- Read a downloaded PDF
After downloading, use `pypdf` to extract text (requires `pip install openbrowser-ai[pdf]`):
openbrowser-ai -c - <<'EOF'
from pypdf import PdfReader
reader = PdfReader(path)
print(f"Pages: {len(reader.pages)}")
# Extract text from all pages
for i, page in enumerate(reader.pages):
text = page.extract_text()
print(f"--- Page {i+1} ---")
print(text[:500])
EOFStep 5 -- Read other file types
openbrowser-ai -c - <<'EOF'
from pathlib import Path
file_path = Path(path)
# CSV
if file_path.suffix == ".csv":
import pandas as pd
df = pd.read_csv(file_path)
print(df.to_string())
# JSON
if file_path.suffix == ".json":
import json
data = json.loads(file_path.read_text())
print(json.dumps(data, indent=2))
# Plain text
if file_path.suffix in (".txt", ".md", ".log"):
print(file_path.read_text())
EOFStep 6 -- Download multiple files
openbrowser-ai -c - <<'EOF'
urls = [
"https://example.com/report-q1.pdf",
"https://example.com/report-q2.pdf",
"https://example.com/report-q3.pdf",
]
paths = []
for url in urls:
path = await download_file(url)
paths.append(path)
print(f"Downloaded: {path}")
print(f"Total files: {len(paths)}")
EOFStep 7 -- List all downloads
openbrowser-ai -c - <<'EOF'
files = list_downloads()
for f in files:
print(f)
print(f"Total: {len(files)} files")
EOFStep 8 -- Download from authenticated pages
`download_file()` preserves the browser's login session. Log in first, then download:
openbrowser-ai -c - <<'EOF'
# Navigate and log in
await navigate("https://portal.example.com/login")
await input_text(username_index, "user@example.com")
await input_text(password_index, "password")
await click(login_button_index)
await wait(2)
# Now download an authenticated resource
path = await download_file("https://portal.example.com/api/reports/confidential.pdf")
print(f"Downloaded: {path}")
EOFTips
- Code is piped via stdin using heredoc (`-c - <<'EOF'`), so all Python syntax works without shell escaping issues.
- Use `download_file(url)` instead of `navigate(url)` for files. `navigate()` opens PDFs in the browser viewer but does not save them.
- `download_file()` preserves cookies and authentication -- no need to re-authenticate.
- Filename conflicts are handled automatically with `(N)` suffix (e.g., `report (1).pdf`).
- If no filename is provided, it is derived from the URL path.
- Use `list_downloads()` to see all files saved in the downloads directory.
- For large files, `download_file()` has a 120-second timeout.
- The fallback strategy uses Python `requests` if the browser fetch fails (e.g., CORS restrictions), but without browser cookies.
Cleanup
This step is **mandatory**. Run it after every download run, whether the file landed successfully or the request failed. Without it, the daemon keeps Chrome running until its 10-minute idle timeout, leaving a stale browser process, a locked profile, and (on macOS/Linux desktop) a visible window.
Stop the daemon, then verify it is gone:
openbrowser-ai daemon stop openbrowser-ai daemon
OpenBrowser is a framework for intelligent browser automation. It combines direct CDP communication with a CodeAgent architecture, where the LLM writes Python code executed in a persistent namespace, to navigate, interact with, and extract information from web pages autonomously.
Repo: billy-enrizky/openbrowser-ai
Other skills on openbrowser-ai.
- /accessibility-audit
Audit web pages for accessibility issues, WCAG compliance, and screen reader compatibility. Trigger when the user asks to: check accessibility, run an a11y audit, test WCAG compliance, check screen reader support, audit ARIA attributes, verify keyboard navigation, find
Open skill - /deep-research
Conduct deep web research using the openbrowser-ai agent: decompose a query, investigate sub-questions across multiple sources, and produce a cited markdown report plus structured JSON under local_docs/research/. Trigger when the user asks to: research a topic, do a deep dive,
Open skill - /e2e-testing
Test web applications end-to-end by simulating user interactions and verifying expected outcomes. Trigger when the user asks to: test a web app, verify a user flow, run end-to-end tests, QA a feature, check that a page works correctly, validate user journeys, or test a
Open skill - /form-filling
Fill out web forms, submit data, and handle login or registration flows. Trigger when the user asks to: fill a form, submit data on a website, log in to a site, register an account, complete a checkout, enter information into fields, or automate form submission.
Open skill - /page-analysis
Analyze web page content, structure, and layout to understand what a page contains and how it is organized. Trigger when the user asks to: analyze a page, understand page structure, inspect a website, summarize page content, examine page layout, review a web page, or describe
Open skill - /web-scraping
Extract structured data from websites, scrape page content, and collect information across multiple pages. Trigger when the user asks to: extract data from a website, scrape a page, collect information from URLs, pull content from web pages, gather data across multiple pages, or
Open skill

