技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
python-extraction【数据与研究】Use Trafilatura's Python APIs to extract text, metadata, comments, tables, and structured TXT/Markdown/JSON/HTML/XML/XML-TEI from in-memory HTML inputs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task needs Trafilatura's Python API to turn an already available HTML payload, response body, or parsed LXML tree into extracted article text, metadata, comments, tables, or structured output.
str, bytes, response-like objects with .data, or lxml.html.HtmlElement inputs.extract(), bare_extraction(), extract_with_metadata(), extract_metadata(), html2txt(), baseline(), and load_html().output_format among txt, markdown, json, html, csv, xml, and xmltei.Extractor settings objects, prune_xpath, date parameters, language filtering, and config-driven size limits.None output, too-short results, malformed HTML, metadata/date surprises, and Markdown/XML conversion quirks.cli-batch-processing.discovery-downloads.corpus-quality.None, metadata is missing, language filtering behaves unexpectedly, or output formatting looks wrong.trafilatura installed to verify the basic no-network API surface.from trafilatura import extract
html = """<html><body><article><h1>Title</h1><p>Main article text.</p></article></body></html>"""
text = extract(html, include_comments=False)
if text is None:
# Retry with recall or a fallback API; see references/workflows.md.
...
target_language body-language detection and speedups, depends on optional extras such as trafilatura[all]; handle absence as a runtime capability limit, not as an extraction bug.