Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nstevens1040/anglesharp.domparser

This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.
https://github.com/nstevens1040/anglesharp.domparser

csharp document-object-model dom dotnet-framework html library parser powershell windows-powershell

Last synced: 22 days ago
JSON representation

This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.

Awesome Lists containing this project

README

        

[![Build status](https://ci.appveyor.com/api/projects/status/5x3fsql3hg4aokym?svg=true)](https://ci.appveyor.com/project/nstevens1040/anglesharp-domparser)
# AngleSharp.DOMParser
This library uses [AngelSharp](https://github.com/AngleSharp/AngleSharp) to parse an HTML string into a document object model. The library targets **.NET Framework 4.7.2** so that it is compatible with **Windows PowerShell**.
## Build the Library
Compiling in **Windows PowerShell**
```ps1
git clone https://github.com/nstevens1040/AngleSharp.DOMParser.git
cd .\AngleSharp.DOMParser\
MSBuild.exe -p:RestorePackagesConfig=true -t:restore
MSBuild.exe .\AngleSharp.DOMParser\AngleSharp.DOMParser.csproj
```
## Load the Library
Into **Windows PowerShell** and then test it.
```ps1
Add-Type -Path .\AngleSharp.DOMParser\bin\build\AngleSharp.DomParser.dll
$html_string = @"




Testing HTML


Heading




subtitle


paragraph


Test succeeded!


"@
$document = [AngleSharp.DomParser]::GetDomDocument($html_string)
$document.GetElementById("test").TextContent
```
If the test succeeds, then your PowerShell output will be
```ps1
Test succeeded!
```