Communitygithub.com

baronguyen001/ai-automation-skills

표준 라이브러리만 사용하여 HTML을 깨끗한 일반 텍스트로 변환합니다 (BeautifulSoup/lxml 불필요): script/style을 제거하고, 블록 태그를 줄바꿈으로 변환하며, 공백을 압축합니다. 사용자가 HTML 페이지/이메일에서 읽을 수 있는 텍스트를 원하거나, 스크래핑한 HTML을 LLM에 보내기 전에 정리하거나, 웹 콘텐츠로부터 텍스트 인덱스를 구축할 때 사용하세요.

ai-automation-skills란 무엇인가요?

이 스킬은 `beautifulsoup4`나 `lxml` 같은 추가 라이브러리 없이 오직 파이썬 표준 라이브러리의 `html.parser.HTMLParser`만을 사용하여 HTML을 깨끗한 일반 텍스트로 변환합니다. `<script>`, `<style>` 블록을 완전히 제거하고, 블록 요소를 줄바꿈으로 변환하며, 연속된 공백과 빈 줄을 압축하여 마크업 없는 평문을 생성합니다. 이는 스크래핑한 콘텐츠를 LLM에 전달하기 전에 토큰 수를 줄이거나, 검색 인덱스를 구축할 때 매우 유용합니다. CLI 명령어나 외부 의존성이 없어 어디서든 쉽게 복사하여 사용할 수 있으며, `html_to_text(html_string)` 형태의 순수 함수로 제공되어 단위 테스트가 용이합니다. 지원 플랫폼은 Claude Code, Cursor, Codex, Windsurf, Cline, Aider 등 모든 AI 비서 도구이며, `assets/htmltext.py` 파일을 프로젝트에 복사하여 즉시 사용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/html-to-text

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

HTML을 텍스트로 변환

HTML(스크래핑한 페이지, 뉴스레터 본문, 피드 항목 콘텐츠 등)이 있고 beautifulsoup4나 lxml을 추가하지 않고 깨끗하고 읽기 쉬운 일반 텍스트를 얻고 싶을 때 이 스킬을 사용하세요. 작은 HTMLParser 서브클래스가 <script>/<style>을 제거하고, 블록 요소를 줄바꿈으로 변환하며, 공백을 압축합니다. 이는 콘텐츠를 LLM에 보내기 전(토큰 수 감소)이나 검색 인덱스에 넣기 전에 딱 맞는 형태입니다.

호출 시점

  • 사용자가 "이 HTML에서 텍스트를 추출해줘", "이 스크래핑한 페이지를 정리해줘", "요약하기 전에 태그를 제거해줘", "이 이메일 HTML을 텍스트로 변환해줘"라고 말할 때.
  • HTML이 모델이나 요약본에 입력되려고 하는데 마크업이 잡음일 때.

호출하지 말아야 할 때

  • 구조(표, 링크를 마크다운으로)를 유지해야 하는 경우 - 실제 HTML-to-Markdown 변환기를 사용하세요.
  • 페이지가 JavaScript로 렌더링되는 경우 - 먼저 헤드리스 브라우저로 가져온 다음 변환하세요.

구체적인 예시

사용자 입력:

이 기사 HTML을 일반 텍스트로 변환해서 더 적은 토큰으로 요약할 수 있게 해줘.

출력:

# assets/htmltext.py를 프로젝트에 복사한 후:
from htmltext import html_to_text

text = html_to_text(article_html)
summary = call_llm(f"Summarize:\n{text}")

<script>와 <style> 블록은 완전히 제거되고, 블록 태그는 줄바꿈이 되며, 연속된 공백/빈 줄은 압축되어 출력이 산문처럼 읽힙니다.

적용할 패턴

  1. convert_charrefs=True로 html.parser.HTMLParser를 서브클래싱하여 엔티티가 자동으로 디코딩되도록 합니다.
  2. script/style/head에 대한 건너뛰기 깊이를 추적하여 해당 텍스트가 출력에 절대 누출되지 않도록 합니다.
  3. 블록 태그 주위에 줄바꿈을 추가한 다음, 줄 내 공백과 여러 빈 줄을 압축합니다.
  4. 순수하게 (문자열 입력, 문자열 출력) 유지하여 단위 테스트가 간단합니다.

참조: assets/htmltext.py.

출처

저자의 스크래핑 및 다이제스트 파이프라인에서 추출되었습니다. v1.0.0. 참고: [[rss-feed-reader]], [[gemini-cost-tracker]], [[pipeline-orchestrator]].

→ Trawlkit으로 완전한 실행 가능 봇을 구축하세요.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

baronguyen001/ai-automation-skills

Schedule any script to run on a recurring schedule on Windows (Task Scheduler) or Linux (cron) - register, list, and remove jobs from one command, with logging to a file and a guard against overlapping runs. Use for schedule a script, run nightly, set up a cron job, windows task scheduler, or run on a timer.

baronguyen001/ai-automation-skills

Turn a run's list of result dicts into a schema'd CSV and a Markdown table from one column spec - declare columns once, emit both, with stable ordering and safe escaping, stdlib only, no pandas. Use when the user asks to write results to CSV, export a report, make a markdown summary table, or save a run's output as a spreadsheet.

baronguyen001/ai-automation-skills

Persist records between scheduled runs as append-only JSON Lines (one object per line) with streaming reads and optional key-based dedup, stdlib only. Use when the user wants to log run results to JSONL, append events to a file, dedup records by id across runs, or keep a simple durable history without a database.

baronguyen001/ai-automation-skills

Extract text and simple table-like rows from a PDF for downstream AI without OCR binaries. Use when the user asks to read a PDF, turn a PDF into text, pull simple tables from statements/reports, or feed PDF content into an LLM pipeline.

baronguyen001/ai-automation-skills

Rotate a pool of HTTP/SOCKS proxies with round-robin selection, failure tracking, and a cooldown that benches dead proxies before retrying. BYO proxy list via env - none are shipped. Use for rotate proxies, spread requests across proxies, avoid IP bans, retry through a different proxy, or proxy health check.

baronguyen001/ai-automation-skills

Parse an RSS 2.0 or Atom feed into normalized item dicts (title, link, id, published, summary) with the standard library only - no feedparser. Use when the user asks to read an RSS/Atom feed, poll a blog/news feed, extract feed entries, or watch a site that publishes a feed.

baronguyen001/ai-automation-skills

Upload and download run artifacts from S3-compatible storage with BYO bucket and credentials from env. Use when the user asks to store scraper output, archive reports, publish artifacts to object storage, fetch a prior run file, or use MinIO/R2/Spaces/S3 without hardcoding credentials.

baronguyen001/ai-automation-skills

Draft a short-form TikTok/Reels/Shorts or long-form video script from a topic and creator persona file - hook variants, beat-structured body, CTA, b-roll cues, caption overlays, and [STORY]/[NUMBER] slots so the model never fabricates personal facts. Use for write a video script, tiktok script, youtube script, or /shortform-script.

baronguyen001/ai-automation-skills

Give scheduled scripts memory between runs with one SQLite file - a seen-set for dedup, a key/value cursor to resume where you left off, and order-preserving new-item filtering. Use for dedup across runs, don't re-alert the same item, remember the last id, resume a scraper, or persist state between cron runs.

관련 스킬