Skip to content

select should accept [Tag] #4

Description

@domenkozar

I'd propose to give a following example of using Haquery in ghci, which is one of the common usages of fetching a website and parsing it.

import Haquery (select, parseHtml)
import Network.Wreq (get, responseBody)
import Control.Lens (^.)
import Data.Text (pack)

r <- get "http://nixos.org/channels/"
Prelude.concatMap (select (pack "a")) $ parseHtml $ pack $ show (r ^. responseBody)

Which motivates me to say that select should accept a list of Tags, since that's what parseHtml returns.

PS: I'm fairly new to Haskell ecosystem, so excuse my ignorance :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions