Skip to content
Back to skills

Dom Parser For Playwright Selector Generation

ASecurity

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.

  • 17 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 30, 2026
ai-agentsjavascriptjava

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill dom-parser-for-playwright-selector-generation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dom Parser For Playwright Selector Generation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dom Parser For Playwright Selector Generation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-dom-parser-for-playwright-selector-generation/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-dom-parser-for-playwright-selector-generation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "9ff1692d-3afb-4c3d-9659-2215a039d46d"
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."
version: "0.1.0"
tags:
  - "javascript"
  - "dom parsing"
  - "playwright"
  - "html filtering"
  - "gpt optimization"
triggers:
  - "parse html for playwright selectors"
  - "filter dom for gpt"
  - "clean html for automation"
  - "extract selector data"
  - "reduce html token size"
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.