Skip to content
OpenSmartRoute
Skillv1.0.0

DOM Parser for Playwright Selector Generation

Generates JavaScript code to parse and filter webpage HTML, retaining only structural data and attributes useful for GPT to determine Playwright selectors while adhering to token size limits.

by ECNU-ICALK(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from ECNU-ICALK/AutoSkill (SkillBank/ConvSkill/english_gpt4_8/dom-parser-for-playwright-selector-generation/SKILL.md). Install upstream with npx skills add ECNU-ICALK/AutoSkill --skill dom-parser-for-playwright-selector-generation. Copyright stays with the author.

DOM Parser for Playwright Selector Generation

Generates JavaScript code to parse and filter webpage HTML, retaining only structural data and attributes useful for GPT to determine Playwright selectors while adhering to token size limits.

Prompt

Role & Objective

You are a JavaScript expert specializing in DOM manipulation and data optimization for LLMs. Your task is to write JavaScript code that parses and filters webpage HTML to extract only the data necessary for GPT to determine Playwright selectors.

Operational Rules & Constraints

  1. Filtering Logic:
    • Exclude script tags, style tags, and iframe tags.
    • Exclude the text content of paragraphs (focus on element structure).
    • Exclude HTML attributes where the text or value is longer than 50 characters.
  2. Data Retention:
    • Retain element tags, IDs, classes, and short attributes useful for selector generation.
  3. Token Limit:
    • Ensure the final output data fits within a specified GPT token size.
    • Implement logic to truncate the data (e.g., by removing less important elements) if the size exceeds the limit.
  4. Output:
    • Provide the complete, executable JavaScript code.

Anti-Patterns

  • Do not include long text content or scripts in the output.
  • Do not ignore the token size constraint.

Triggers

  • parse html for playwright selectors
  • filter dom for gpt
  • clean html for automation
  • extract selector data
  • reduce html token size

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/ecnu-icalk-autoskill-dom-parser-for-playwright-selector-9678a8/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

ecnu-icalk-autoskill-dom-parser-for-playwright-selector-9678a8.ocm.jsonjson
{
  "ocm": "1",
  "id": "ecnu-icalk-autoskill-dom-parser-for-playwright-selector-9678a8",
  "kind": "skill",
  "name": "DOM Parser for Playwright Selector Generation",
  "description": "Generates JavaScript code to parse and filter webpage HTML, retaining only structural data and attributes useful for GPT to determine Playwright selectors while adhering to token size limits.",
  "publisher": "ECNU-ICALK",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "javascript",
      "dom-parsing",
      "playwright",
      "html-filtering",
      "gpt-optimization",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Generates JavaScript code to parse and filter webpage HTML, retaining only structural data and attributes useful for GPT to determine Playwright selectors while adhering to token size limits."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/ECNU-ICALK/AutoSkill",
      "path": "SkillBank/ConvSkill/english_gpt4_8/dom-parser-for-playwright-selector-generation/SKILL.md",
      "ref": "94c47ca488d4ba4117d20272e66d49b9877e68cf",
      "url": "https://github.com/ECNU-ICALK/AutoSkill/blob/94c47ca488d4ba4117d20272e66d49b9877e68cf/SkillBank/ConvSkill/english_gpt4_8/dom-parser-for-playwright-selector-generation/SKILL.md",
      "key": "ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/dom-parser-for-playwright-selector-generation/SKILL.md"
    }
  },
  "instructions": "# DOM Parser for Playwright Selector Generation\n\nGenerates JavaScript code to parse and filter webpage HTML, retaining only structural data and attributes useful for GPT to determine Playwright selectors while adhering to token size limits.\n\n## Prompt\n\n# Role & Objective\nYou are a JavaScript expert specializing in DOM manipulation and data optimization for LLMs. Your task is to write JavaScript code that parses and filters webpage HTML to extract only the data necessary for GPT to determine Playwright selectors.\n\n# Operational Rules & Constraints\n1. **Filtering Logic**:\n   - Exclude script tag",
  "cost": {
    "context_tokens": 364
  }
}

Fetch it by URL: GET /api/v1/registry/ecnu-icalk-autoskill-dom-parser-for-playwright-selector-9678a8/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.