Skip to content

Instantly share code, notes, and snippets.

@dbalan
Created August 2, 2016 20:48
Show Gist options
  • Save dbalan/600c3aa38b482f095c4d9902c8994946 to your computer and use it in GitHub Desktop.
Save dbalan/600c3aa38b482f095c4d9902c8994946 to your computer and use it in GitHub Desktop.
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