9

What other options currently exist for parsing html in F#? Currently have some regular expressions but would prefer something like Pythons Beautiful Soup http://www.crummy.com/software/BeautifulSoup/ or be able to using an api similar to jQuery from F#.

I have seen the fslex and fparsec but I'm not sure if someone else has already built some html parsing library with these or I would have to write my own.

Brian
  • 117,631
  • 17
  • 236
  • 300
yanta
  • 841
  • 1
  • 9
  • 19

2 Answers2

8

I have not tried using this (from F# or otherwise) but the Html Agility Pack seems to be the preferred solution for .NET.

What is the best way to parse html in C#?

Community
  • 1
  • 1
Brian
  • 117,631
  • 17
  • 236
  • 300
  • I've been using this for over a year now and really like it. I ran into one XPath bug, but otherwise it's been totally reliable. – Daniel Nov 04 '10 at 19:36
  • What was the XPath bug? I've been using this library with XPath and so far it's been good. Hoping for some other options though. – yanta Nov 06 '10 at 07:03
  • @yanta, apparently "Html Agility Pack now supports Linq to Objects (via a LINQ to Xml Like interface)." Though I'm unsure how that can be leverage through F#. – Stephen Swensen Nov 08 '10 at 00:54
1

Today there is an F# Data library that has an Html Parser and ability of Html CSS Selectors (same as jQuery selectors). Also library has Html Type Provider.

andrew
  • 412
  • 2
  • 14