Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The 200 That Came From the Wrong Page

Описание и применение

Скрипт, собирающий данные с панели продаж, иногда загружал неверную страницу, возвращая 200 без аналитики. Добавлен контроль заголовка страницы, чтобы отклонять неверные ответы и записывать пропуски вместо ложных нулей.

Задача

A reader script scraped sales dashboard data but sometimes fetched the wrong page, returning HTTP 200 with no analytics data, risking incorrect metrics in the CSV.

Результат

The guard prevents false data entry by ensuring the page matches expectations, turning potential errors into documented holes rather than fabricated zeros.

Рабочий процесс

  • 1. Define constants ROTA (expected route) and TITULO_ESPERADO (expected title substring).
  • 2. Navigate to target URL.
  • 3. Retrieve page title.
  • 4. Compare title to TITULO_ESPERADO; if mismatch, exit with code 3 and log receipt.
  • 5. If title matches, scrape numeric metrics and append to CSV.
  • 6. Run acceptance test pointing reader at public storefront to confirm guard rejects it.
  • 7. Verify CSV remains unchanged on rejection and correct data is recorded on successful runs.

Доказательства

After navigation, the reader compares the live page title against the expectation.

Источник

The acceptance test replayed the real incident: point the reader at the public storefront page and demand a reading. It refused with exit 3, receipt showing titulo lido: Second Brain Starter, and the series untouched.

Источник

  • Дата записи: 2026-09-13T05:00:58.398Z