[Haskell-cafe] looking for tagsoup-parsec examples

José Romildo Malaquias j.romildo at gmail.com
Mon Nov 22 15:53:06 EST 2010

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

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: parsehtml.hs
Type: text/x-haskell
Size: 1124 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20101122/54d8be2b/parsehtml.bin

More information about the Haskell-Cafe mailing list