Documentation Index
Fetch the complete documentation index at: https://docs.therefrain.ai/llms.txt
Use this file to discover all available pages before exploring further.
競合の EC サイトで価格や在庫を手動でチェックするのは時間がかかり、スケールしません。スクレイピングスクリプトはサイトのリニューアルのたびに壊れます。
Refrain なら、取得したいデータを伝えるだけで自己修復する手順書を生成し、スケジュール実行できます。サイトのレイアウトが変わっても手順書が自動的に適応します。
手順書の例
name: competitor-price-check
url: https://shop.example.com/products
variables:
- name: product_url
source: data
steps:
- action: navigate
url: "{{ product_url }}"
- action: wait
selector: ".product-detail"
- action: extract
selector: ".price-current"
capture: price
- action: extract
selector: ".stock-status"
capture: stock
- action: export
format: csv
fields:
- name: url
value: "{{ product_url }}"
- name: price
value: "{{ price }}"
- name: stock
value: "{{ stock }}"
生成と実行
手順書を生成する
npx @refrainai/cli generate -- \
--url https://shop.example.com/products/sample \
--goal "現在の価格と在庫状況を取得する" \
--context ./context.md \
--output ./price-check.yaml
商品リストを準備する
監視対象の URL を CSV にまとめます:product_url
https://shop.example.com/products/001
https://shop.example.com/products/002
https://shop.example.com/products/003
バッチ実行する
npx @refrainai/cli execute -- \
--runbook ./price-check.yaml \
--data ./products.csv \
--output-dir ./reports
Refrain が向いている理由
- バッチ実行 — CSV 1 ファイルで数百商品を一括監視。
- 自己修復 — サイトリニューアルでもスクリプトの書き直し不要。
- スケジュール実行 — Web コンソールのスケジューラーで毎日・毎時の定期チェック。
- Slack 通知 — 価格変動や在庫切れを即座に通知。
次のステップ
手順書を実行する
CSV データを使ったバッチ実行を学ぶ。
承認と通知
価格変動時の Slack 通知を設定する。