feat(tradein): yandex_detail.py — Product JSON-LD + DOM detail parser #466
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#466
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-yandex-detail-parser"
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?
Motivation
Stage 4 of 9 for YandexRealtyScraper v1 (Wave 4 / Worker A — parallel with #PRs
yandex_newbuilding.pyandyandex_valuation.py).Module
tradein-mvp/backend/app/services/scrapers/yandex_detail.py—YandexDetailScraper(BaseScraper)with asyncfetch_detail(offer_url). Authoritative price comes from Product JSON-LDoffers.price(exact int); DOM sections supply description, agent block, summary stats, metro, photos, NLP fields.DetailEnrichment fields
offer_id,source_urlprice_rub(Product LD),price_per_m2(summary text fallback)title,rooms,area_m2,floor,total_floorsaddress(full RU format)description(text of section after H2 "Описание")sale_type_text(raw RU phrase)views_total,publish_date,publish_date_relativeagency_name,agency_founded_year,agency_objects_count,seller_namemetro_stations: list[MetroStation]from "Расположение"photo_urls(8 sizes from Product.image[] array)newbuilding_url,newbuilding_idhouse_type_nlp,year_built_hint,metro_walk_minTests
Worker notes (worth tracking)
selectolax.text(strip=True)concatenates text nodes without separators. When the agency block uses separate inline elements (e.g. "Год основания 2003" in one span + "247 объектов" in another), the digit strings merge into"2003247 объектов"andRE_AGENCY_OBJECTSmisfires. Fixture HTML in tests uses a single<p>to avoid this. Real Yandex DOM may need additional whitespace normalization — followup for production smoke orlimitations/vault entry.Files
tradein-mvp/backend/app/services/scrapers/yandex_detail.py(new, 369 lines)tradein-mvp/backend/tests/test_yandex_detail.py(new, 399 lines)Reviewer note
Reviewer: deep-code-reviewer — only merge after APPROVE. Wave 4 sibling PRs: yandex_newbuilding.py + yandex_valuation.py.
Deep code review — verdict APPROVE, merged (squash, commit
3d90221).Reviewed:
_safe_url(cdn=True)intrade_in_pdf.py:63allowlistsavatars.mds.yandex.net. Frontend<img src>no JS exec. Acceptable for pilot.find_ld_by_type,parse_house_type,parse_ru_date,parse_rub,RE_AGENCY_*,RE_METRO_WALK,RE_VIEWS,RE_YEAR) — all present inyandex_helpers.py.fetch_aroundraisesNotImplementedError(offer-id-based scraper),_http_get+sleep_between_requestsused per pattern.Worker's whitespace note acknowledged (selectolax
.text(strip=True)concatenation):RE_AGENCY_OBJECTSmisfires..text(separator=' ', strip=True)or iterate child nodes with manual joining. Non-blocking — fixture uses<p>workaround.Gap (non-blocking, recommended followup): real Yandex HTML snapshot test to catch DOM drift.
Wave 4 sibling PRs (#467 newbuilding, #468 valuation) target different files — no conflict expected.