Created
April 6, 2012 18:40
-
-
Save YPares/2321986 to your computer and use it in GitHub Desktop.
JV.com last tests
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
import Text.XML.HXT.Core | |
import Text.XML.HXT.HTTP | |
import Data.List (isInfixOf) | |
import Data.String.EncodingNames (isoLatin1) | |
loop [] = return () | |
loop (date:title:plat:xs) = putStrLn (date ++ title ++ " " ++ plat) >> loop xs | |
main = runX ( readDocument [ withParseHTML yes, withHTTP [], withInputEncoding isoLatin1 ] "http://www.jeuxvideo.com/tests.htm" | |
//> (hasName "li" </ (hasName "a" `guards` hasAttrValue "href" ("test.htm" `isInfixOf`))) | |
/> (hasName "strong" <+> hasName "a") /> getText | |
) >>= loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment