HF RL Explorer

Task: Extract Direct Text from HTML Element (Excluding Child Elements)

Task: Extract Direct Text from HTML Element (Excluding Child Elements): a task in Terminal-Lego-15k (Harbor dataset). When parsing HTML with BeautifulSoup, the .text property returns all text content including text from nested child elements. Your task is to write a Python script that extracts…

The task

When parsing HTML with BeautifulSoup, the `.text` property returns all text content including text from nested child elements. Your task is to write a Python script that extracts **only** the direct text content of the top-most element, excluding any text contained within child elements.

Part of PrimeIntellect/Terminal-Lego-15k.