fimad / scalpel

A high level web scraping library for Haskell.
Apache License 2.0
323 stars 43 forks source link

howto extract all attribute pairs of a tag #86

Closed agreif closed 4 years ago

agreif commented 4 years ago

is there a way to extract all attributes with their values of tags? example"

  <img src="foo.gif" title="My Foo">
  <img src="bar.gif" title="My Bar">

I would like to get a list of tuples [("foo.gif","My Foo"), ("bar.gif","My Bar")]

I am able to find all img tags with a src attribute, but I see no way to get the title to the corresponding img tag.

agreif commented 4 years ago

found the solution in 'https://github.com/fimad/scalpel/blob/master/examples/generalized-repetition/Main.hs'