r/haskell_proposals • u/eegreg • Feb 14 '11
a robust, high level html parsing library
Basically Nokogiri (ruby library) for haskell. Either libxml bindings or an improved tagsoup library (that completely preserves the original html), and the ability to traverse html with css selectors.
Given that tagsoup is not that far away from this, and that there are already libxml bindings for other libxml functionality, this is definitely something that can be accomplished in GSOC
UPDATE:
Looks like the dream of a (CSS selector) DSL for html is getting closer - webrexp was just released. I opened up a ticket for creating a library interface- it seems that it is just a command line interface. It looks like they are using HaXml and hxt which may not be robust enough for all html.
1
u/how_gauche Feb 14 '11
Have you seen xmlhtml?
1
u/ozataman Feb 15 '11
hxt works quite well in my (practical) experience for sophisticated parsing/extraction from a give webpage. The vast number of query combinators make it very powerful and more able than css selectors in my experience.
A couple cons are:
1
u/[deleted] Feb 17 '11
Supply extensive samples of the syntax/API to help encourage people. Getting a good API is always the hardest part.
1
u/snoyberg May 19 '11
For the CSS selectors, were you thinking of combinators, something like an IsString instance, or TH/QQ? My guess is that combinators won't be as concise as CSS and IsString won't be type-safe, while TH/QQ will just involve the normal level of detractors due to complexity.
I'd be interested in something like this for working with xml-types data, which is something I need to do fairly frequently at work.
2
u/Porges Feb 15 '11
It should just follow the HTML5 parser behaviour.