Trying to use HtmlAgilityPack

dll html-agility-pack

Question

Im having problems trying to install the HtmlAgilityPack.dll ver 1.4. I've copied the files into my windows\system32 folder and tried regsvr32 htmlagilitypack.dll in run.

I got the following error:

The module was loaded but the entry point DllUnregisterServer was not found.

It seems to be a common library used by many people on SO so the dll's cant be corrupted. How do I fix this?

Accepted Answer

The reason you can't use regsvr32 is because the HTML Agility pack isn't a COM library. It's written in .NET, so you need to reference from a .NET project.

  1. Download the latest zip file and extract somewhere on your local hard disk e.g. c:\SharedLibs\HtmlAgilityPack.
  2. Launch Visual Studio (or one of the VS Express editions)
  3. Create a new project or open an existing one.
  4. In solution explorer right click on References and click Add Reference.
  5. Click the Browse tab and browse to where you extracted the agility pack
  6. Select the HtmlAgilityPack.dll DLL
  7. Click OK

Refer to the CodePlex site:

Html Agility Pack Home
Html Agility Pack Examples

Here's a couple of links I dug up in everyone's favourite search engine:

A simple web crawler in C# using HtmlAgilityPack
.NET Html Agility Pack: How to use malformed HTML just like it was well-formed XML...




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why