feat(avito): capture newbuilding ЖК id/url from SERP card #1729
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1729
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/avito-newbuilding-capture"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Captures avito ЖК (newbuilding) linkage. Novostroyka SERP cards (detected via
item-development-name, merged in #1716) carry azhk-<slug>.avito.ruanchor — now parsed intolistings.newbuilding_id/newbuilding_url(columns existed, were unwired in base.py save).Changes
avito.py _dom_card_to_lot: for novostroyka cards, finda[href*="zhk-"][href*=".avito.ru"]→newbuilding_url(scheme+host+path, tracking stripped via urlparse/urlunparse),newbuilding_id= slug (host minuszhk-prefix /.avito.rusuffix). None for vtorichka or novostroyka without anchor.base.py:ScrapedLot+=newbuilding_id/newbuilding_url; wired into save_listings INSERT/VALUES/UPDATE (COALESCE(EXCLUDED.x, listings.x), additive — edits are in the ScrapedLot+INSERT/UPDATE region, NOT_link_listing_to_house, so no overlap with #1727).Note: cian stores newbuilding_name only in raw_payload (not on the lot), so this base wiring affects only avito for now. yandex_detail.py has its own UPDATE (unaffected).
Test plan
pytest -k "avito or save_listings or base"→ 256 passed; ruff cleanSELECT count(*) FILTER(WHERE newbuilding_url IS NOT NULL) FROM listings WHERE source='avito'> 0 after a sweep that hits novostroykiRefs #1188