MCPcopy Create free account
hub / github.com/Alibaba-NLP/DeepResearch / parse_html

Function parse_html

inference/file_tools/file_parser.py:387–400  ·  view source on GitHub ↗
(file_path: str)

Source from the content-addressed store, hash-verified

385
386
387def parse_html(file_path: str) -> List[dict]:
388 from bs4 import BeautifulSoup
389
390 with open(file_path, 'r', encoding='utf-8') as f:
391 soup = BeautifulSoup(f, 'lxml')
392
393 content = [{'text': clean_text(p.get_text())}
394 for p in soup.find_all(['p', 'div']) if p.get_text().strip()]
395
396 return [{
397 'page_num': 1,
398 'content': content,
399 'title': soup.title.string if soup.title else ''
400 }]
401
402
403def extract_xml_skeleton_markdown(xml_file):

Callers

nothing calls this directly

Calls 1

clean_textFunction · 0.85

Tested by

no test coverage detected