Created
August 2, 2016 20:48
-
-
Save dbalan/600c3aa38b482f095c4d9902c8994946 to your computer and use it in GitHub Desktop.
This file contains 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
module Main where | |
import Lib | |
import Text.HTML.Scalpel | |
data Image = Image String deriving Show | |
comicImage :: IO (Maybe [String]) | |
comicImage = do | |
scrapeURL "http://doc.scrapy.org/en/latest/_static/selectors-sample1.html" comic | |
where | |
comic :: Scraper String [String] | |
comic = chroots ("a") $ do | |
author <- attr "href" Any | |
return author | |
main :: IO () | |
main = do | |
putStrLn "hello" | |
scr <- comicImage | |
case scr of | |
Nothing -> putStrLn "error" | |
Just x -> mapM_ putStrLn (x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment