agentleFS
taurgistaurgis/sfcc-dev-mcp/.github/skills/salesforce-developer-site-scraper/SKILL.md

salesforce-developer-site-scraper

Skill27 starsChanged 10 months agoMITView on GitHub

Scrape Salesforce Developer documentation into clean Markdown using headless Chromium, Readability, and the docs content API fallback. Use when content is async or blocked by OneTrust cookie banners.

  • Installs packages

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to capture Salesforce Developer documentation pages as clean Markdown even when content loads asynchronously or is blocked …

    line 10
  2. Distinctive:

    NOT for: high-volume crawling or scraping behind access restrictions.

    line 17
  3. Distinctive:

    Use consent cookies or storage state only when you have permission.

    line 60
  4. Distinctive:

    Avoid collecting personal data unless you have a legal basis.

    line 61
  5. Very specific:

    Solution: Add --wait or provide a --content-selector for the primary content node.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Salesforce Developer Site Scraper

Use this skill to capture Salesforce Developer documentation pages as clean Markdown even when content loads asynchronously or is blocked by OneTrust cookie banners.

When to Use This Skill

  • A Salesforce Developer doc page renders key content after async requests.
  • A OneTrust cookie banner hides content until consent is accepted.
  • You need a readable Markdown snapshot for Apex, LWC, or platform docs.
  • NOT for: high-volume crawling or scraping behind access restrictions.

Prerequisites

  • Node.js 18+
  • npm dependencies for the script (see below)

How to Use

1) Install script dependencies (if not done already)

npm install playwright @mozilla/readability jsdom turndown

2) Run the script

node skills/salesforce-developer-site-scraper/scripts/scrape-to-markdown.js \
  --url "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro.htm" \
  --out "./artifacts/online-research/apex_intro.md" \
  --consent-selector "#onetrust-accept-btn-handler" \
  --wait 2000

Script Options

OptionRequiredDescription
--urlYesTarget URL to fetch and extract.
--outYesOutput Markdown file path.
--consent-selectorNoCSS or text selector for a cookie banner accept button.
--waitNoMilliseconds to wait after navigation or consent click.
--content-selectorNoExtract only this element instead of Readability parsing.
--remove-selectorsNoComma-separated selectors to remove before extraction.
--cookieNoConsent/session cookie, e.g. name=value;domain=example.com;path=/.
--storage-stateNoPlaywright storage state JSON file to reuse consent/session.
--timeoutNoNavigation timeout in ms (default 45000).
--no-default-removalsNoDisable default cookie/consent element removals.

Compliance Notes

  • Respect robots.txt and site terms before scraping.
  • Use consent cookies or storage state only when you have permission.
  • Avoid collecting personal data unless you have a legal basis.

Examples

Example: Reuse a consent state

node skills/salesforce-developer-site-scraper/scripts/scrape-to-markdown.js \
  --url "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro.htm" \
  --out "./artifacts/online-research/apex_intro.md" \
  --storage-state "./artifacts/online-research/consent-state.json"

Example: Extract a specific content container

node skills/salesforce-developer-site-scraper/scripts/scrape-to-markdown.js \
  --url "https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro.htm" \
  --out "./artifacts/online-research/apex_intro.md" \
  --content-selector "main article"

Troubleshooting

Issue: Output is empty or too short

Solution: Add --wait or provide a --content-selector for the primary content node.

Issue: Cookie banner blocks content

Solution: Provide --consent-selector (OneTrust) or reuse a --storage-state with consent already saved.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.