
Hello. I am looking for some examples of code using Text.HTML.TagSoup.Parsec, from the tagsoup-parsec package. Romildo

On Mon, Nov 22, 2010 at 02:20:22PM -0200, José Romildo Malaquias wrote:
I am looking for some examples of code using Text.HTML.TagSoup.Parsec, from the tagsoup-parsec package.
In an attempt to learn how to use tagsoup together with parsec in order to do web scrapping, I rewrote the application that displays the Haskell.org hit count, explained in the "Drinking TagSoup by Example" tutorial [1]. The source code is attached. First I tried to use tagsoup-parsec [2], but it was not too helpful. Therefore I wrote a few parser combinators myself (inspired by tagsoup-parsec, and the "TagSoup, meet Parsec!" blog post [3]. I am posting the program here so that other Haskell programmers can comment on it. I would like also to do some suggestions to the author of tagsoup-parsec: a) export more functions, like tagEater, which may be needed in order to define new parsers or parser combinators; I needed them, but they were no usable because they are not exported; b) add more basic parsers and parser combinators (at least the ones I have defined in my program). c) add some examples d) use parsec version 3 [1] http://community.haskell.org/~ndm/darcs/tagsoup/tagsoup.htm [2] http://hackage.haskell.org/package/tagsoup-parsec [3] http://therning.org/magnus/archives/367 Regards, Romildo
participants (1)
-
José Romildo Malaquias