This project has moved and is read-only. For the latest updates, please go here.

Using HtmlAgilityPack with F#

Topics: Developer Forum
Apr 28, 2010 at 3:06 AM

Hello everyone,

Is HtmlAgilityPack usable with F#? Has anyone tried, and can provide some info on how to do it/samples?

thanks, Marcelo

Apr 28, 2010 at 4:12 AM

As with any .NET library Html Agility Pack can be used with F#. That being said nothing has been done specifically for F#. F# doesn't like mutability and as such you'll need to declare any HAP objects as Mutable. Using HAP in F# would be a lot like using the System.Xml classes. I do not have any examples of using it in F# though. I've only had some minor dabbling with the language thus far. I'd be interested in any suggestions you may have to make it work nicer with F#.

Apr 28, 2010 at 4:16 AM

Thanks for the reply. I'm starting with it too. I have some crawlers that I'd like to turn into F# due to parallelism. I don't even get to compile using the reference to the dll, unfortunately.

Anything that comes to my mind, I'll let you know.


May 3, 2010 at 1:18 PM


Just to let you know, I downloaded the latest version, tried with F# and it was a wonderful experience.

The crawling worked just as it should, I felt it was a little slower than the C# code, but again, maybe my code needs some optimization. Still, it's wonderful how parallelism can be achieved in a so easy way with F#.



May 3, 2010 at 1:18 PM
Edited May 3, 2010 at 1:19 PM

[removed by the author due to double posting. sorry]