Exception: Html2rss::AutoSource::Scraper::NoScraperFound

Inherits:
Error
  • Object
show all
Defined in:
lib/html2rss/auto_source/scraper.rb

Overview

Error raised when no suitable scraper is found.

Constant Summary collapse

CATEGORY_MESSAGES =
{
  blocked_surface: 'No scrapers found: blocked surface likely (anti-bot or interstitial). ' \
                   'Retry with --strategy browserless, try a more specific public listing URL, ' \
                   'or run from an environment that can complete anti-bot checks.',
  app_shell: 'No scrapers found: app-shell surface detected (client-rendered page with little or no ' \
             'server-rendered article HTML). Retry with --strategy browserless, or target a direct ' \
             'listing/update URL instead of a homepage or shell entrypoint.',
  unsupported_surface: 'No scrapers found: unsupported extraction surface for auto mode. ' \
                       'Try a direct listing/changelog/category URL, ' \
                       'or use explicit selectors in a feed config.'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, category: :unsupported_surface) ⇒ NoScraperFound

Returns a new instance of NoScraperFound.



47
48
49
50
51
# File 'lib/html2rss/auto_source/scraper.rb', line 47

def initialize(message = nil, category: :unsupported_surface)
  validate_category!(category)
  @category = category
  super(message || CATEGORY_MESSAGES.fetch(@category))
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



53
54
55
# File 'lib/html2rss/auto_source/scraper.rb', line 53

def category
  @category
end