Created
July 21, 2015 03:27
-
-
Save lotz84/26ce3f3d29342876ceda to your computer and use it in GitHub Desktop.
web page 内のリンク先URLを列挙する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Lens | |
import Data.Foldable | |
import Network.Wreq | |
import Text.Taggy.Lens | |
import Data.Text.Lazy.Encoding | |
import Data.Maybe | |
main = do | |
r <- get "URL" | |
traverse_ print . catMaybes $ (r ^.. responseBody . to decodeUtf8 . html . allNamed (only "a") . attrs . at "href") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment