Dom parser for playwright selector generation
AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution
npx -y skills add ECNU-ICALK/AutoSkill --skill dom-parser-for-playwright-selector-generationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
What its author says it does
Copied from the file, not written here
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.
SKILL.md
2.0 KB, as published. Nobody here has run it
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
- 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.
- Data Retention:
- Retain element tags, IDs, classes, and short attributes useful for selector generation.
- 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.
- 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