Skip to content

Strategy

The strategy key defines how html2rss fetches a website’s content.

  • faraday (default): Makes a direct HTTP request. It is fast but does not execute JavaScript.
  • browserless: Renders the website in a headless Chrome browser, which is necessary for JavaScript-heavy sites.

To use the browserless strategy, you need a running instance of Browserless.io.

You can run a local Browserless.io instance using Docker:

Terminal window
docker run \
--rm \
-p 3000:3000 \
-e "CONCURRENT=10" \
-e "TOKEN=6R0W53R135510" \
ghcr.io/browserless/chromium

Set the strategy to browserless in your feed configuration:

strategy: browserless

You can also specify the strategy on the command line:

Terminal window
# Set environment variables for your Browserless.io instance
BROWSERLESS_IO_WEBSOCKET_URL="ws://127.0.0.1:3000"
BROWSERLESS_IO_API_TOKEN="6R0W53R135510"
# Use the browserless strategy
html2rss feed --strategy=browserless my_config.yml

For detailed documentation on the Ruby API, see the official YARD documentation.