func (c Cache) ScrapeURL(ctx context.Context, url string, ty models.ScrapeContentType) (models.ScrapedContent, error) {
	for _, s := range c.scrapers {
		if s.supportsURL(url, ty) {
			ul, ok := s.(urlScraper)
			if !ok {
				return nil, fmt.Errorf("%w: cannot use scraper %s as an url scraper", ErrNotSupported, s.spec().ID)
			}
			ret, err := ul.viaURL(ctx, c.client, url, ty)
			if err != nil {
				return nil, err
			}

			if ret == nil {
				return ret, nil
			}

			return c.postScrape(ctx, ret)
		}
	}

	return nil, nil
}
// ScrapeURL scrapes a given url for the given content. Searches the scraper cache
// and picks the first scraper capable of scraping the given url into the desired
// content. Returns the scraped content or an error if the scrape fails.
ScrapeURL scrapes a given url for the given content. Searches the scraper cache
and picks the first scraper capable of scraping the given url into the desired
content. Returns the scraped content or an error if the scrape fails.
// ScrapeURL scrapes a given url for the given content . Searches the scraper cache // and picks the first scraper capable of scraping the given url into the desired // content . Returns the scraped content or an error if the scrape fails .
func (c Cache) ScrapeURL(ctx context.Context, url string, ty models.ScrapeContentType) (models.ScrapedContent, error) {
	for _, s := range c.scrapers {
		if s.supportsURL(url, ty) {
			ul, ok := s.(urlScraper)
			if !ok {
				return nil, fmt.Errorf("%w: cannot use scraper %s as an url scraper", ErrNotSupported, s.spec().ID)
			}
			ret, err := ul.viaURL(ctx, c.client, url, ty)
			if err != nil {
				return nil, err
			}
			if ret == nil {
				return ret, nil
			}
			return c.postScrape(ctx, ret)
		}
	}
	return nil, nil
}
func ( c Cache ) ScrapeURL ( ctx context . Context , url string , ty models . ScrapeContentType ) ( models . ScrapedContent , error ) { for _ , s := range c . scrapers { if s . supportsURL ( url , ty ) { ul , ok := s . ( urlScraper ) if ! ok { return nil , fmt . Errorf ( " " , ErrNotSupported , s . spec ( ) . ID ) } ret , err := ul . viaURL ( ctx , c . client , url , ty ) if err != nil { return nil , err } if ret == nil { return ret , nil } return c . postScrape ( ctx , ret ) } } return nil , nil }
ScrapeURL scrapes a given url for the given content.
ScrapeURL scrapes a given url for the given content .