func (c Cache) ScrapeFragment(ctx context.Context, id string, input Input) (models.ScrapedContent, error) {
	s := c.findScraper(id)
	if s == nil {
		return nil, fmt.Errorf("%w: id %s", ErrNotFound, id)
	}

	fs, ok := s.(fragmentScraper)
	if !ok {
		return nil, fmt.Errorf("%w: cannot use scraper %s as a fragment scraper", ErrNotSupported, id)
	}

	content, err := fs.viaFragment(ctx, c.client, input)
	if err != nil {
		return nil, fmt.Errorf("error while fragment scraping with scraper %s: %w", id, err)
	}

	return c.postScrape(ctx, content)
}
// ScrapeFragment uses the given fragment input to scrape
ScrapeFragment uses the given fragment input to scrape
// ScrapeFragment uses the given fragment input to scrape
func (c Cache) ScrapeFragment(ctx context.Context, id string, input Input) (models.ScrapedContent, error) {
	s := c.findScraper(id)
	if s == nil {
		return nil, fmt.Errorf("%w: id %s", ErrNotFound, id)
	}
	fs, ok := s.(fragmentScraper)
	if !ok {
		return nil, fmt.Errorf("%w: cannot use scraper %s as a fragment scraper", ErrNotSupported, id)
	}
	content, err := fs.viaFragment(ctx, c.client, input)
	if err != nil {
		return nil, fmt.Errorf("error while fragment scraping with scraper %s: %w", id, err)
	}
	return c.postScrape(ctx, content)
}
func ( c Cache ) ScrapeFragment ( ctx context . Context , id string , input Input ) ( models . ScrapedContent , error ) { s := c . findScraper ( id ) if s == nil { return nil , fmt . Errorf ( " " , ErrNotFound , id ) } fs , ok := s . ( fragmentScraper ) if ! ok { return nil , fmt . Errorf ( " " , ErrNotSupported , id ) } content , err := fs . viaFragment ( ctx , c . client , input ) if err != nil { return nil , fmt . Errorf ( " " , id , err ) } return c . postScrape ( ctx , content ) }
ScrapeFragment uses the given fragment input to scrape
ScrapeFragment uses the given fragment input to scrape