fix(scrapers): avito listing_date from sortTimeStamp JSON (#726) #729

Merged
bot-reviewer merged 1 commit from fix/726-avito-listing-date into main 2026-05-30 14:13:39 +00:00

1 commit

Author SHA1 Message Date
d6dca24ea2 fix(scrapers): avito listing_date from sortTimeStamp JSON (#726)
Investigated with a real curl_cffi capture (HTTP 200, 46 cards): the Avito
SERP lazy-renders — data-marker="item-date" appears only on the top
above-the-fold cards (~10/46), so ~79% of cards have no date in the raw HTML
curl_cffi receives. The marker wasn't renamed; the field is just absent.

But every listing carries sortTimeStamp (epoch-ms) in the embedded per-item
JSON (56 occurrences/page) — the line-266 'state empty' note was stale. Map
item_id (= DOM data-item-id) -> sortTimeStamp -> date as the primary source,
keep the DOM item-date + _parse_relative_date as fallback for the top cards.

Verified on the real capture: 42/46 = 91% coverage (was ~21% DOM-only),
clearing the >80% DoD bar. Adds a distilled real-structure fixture
(avito_serp_sample.html) + unit test covering both the JSON (lazy card) and
DOM (top card) paths.

Refs #726
2026-05-30 17:09:41 +03:00