> For the complete documentation index, see [llms.txt](https://docs.tailent.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tailent.com/scripting-utility-classes/common-scripts-repository/c-scripts-repository/filter-html-contents.md).

# Filter HTML Contents

This script can be used to create a new HtmlDocument variable, loading the html code(from a text file, web), selecting the nodes to be parsed, converting the variable into a list and printing the output.

```csharp
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(htmlOutput);
HtmlNodeCollection selectedHtmlNodes = doc.DocumentNode.SelectNodes("//html/body");
selectedHtmlNodes.ToList();
```

{% hint style="info" %}
“InnerText”  - text only

“InnerHtml” - whole html code
{% endhint %}
