scrappy-core-0.1.0.1: html pattern matching library and high-level interface concurrent requests lib for webscraping
Safe HaskellNone
LanguageHaskell2010

Scrappy.Scrape

Synopsis

Documentation

scrapeLinked :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m [String] Source #

Generate a scraping expression where when found, it will generate and link in a data structure | to a relevant next pattern. For instance, an element of interest being found then switches the | scraper expression to be a reference to itselfo | | for instance (el "a" [("id", "x")]) -> let ALPHANUM = document.select(this) -> someThingUsing ALPHANUM_MATCH | in a statement --> which references [A, B, C]

coerceMaybeParser :: Maybe a -> ScraperT a Source #

Super common case analysis

hoistMaybe :: forall (m :: Type -> Type) a. Applicative m => Maybe a -> MaybeT m a Source #

scrape :: ScraperT a -> Html -> Maybe [a] Source #

getFirstFitSafe :: (a -> Bool) -> Maybe [a] -> Maybe a Source #

findFit :: (a -> Bool) -> [a] -> Maybe a Source #

runScraperOnHtml :: ParsecT String () Identity a -> String -> Maybe [a] Source #

Find all occurences of a given parsing/scraping pattern | e.g. getHtml' "https://google.ca" >>= return . runScraperOnHtml (el "a" []) , would give all a tag html elements on google.ca

scrapeIO :: (MonadIO m, Show a, Stream String m Char) => ParsecT String () m a -> String -> m (Maybe [a]) Source #

skipToInBody :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m () Source #

skipToBody :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m () Source #

scrapeFirst :: forall s (m :: Type -> Type) u a. Stream s m Char => ParsecT s u m a -> ParsecT s u m (Maybe a) Source #

findCount :: forall s (m :: Type -> Type) u a. Stream s m Char => ParsecT s u m a -> ParsecT s u m Int Source #

scrapeBracketed :: Prefix' -> ScraperT a -> Html -> Maybe [a] Source #

Deprecated: experimental, first attempt