fix(tradein): yandex_realty captures house number + parse_rub strips NBSP #593
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#593
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/yandex-realty-address-with-house-number"
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
Two critical bugs в yandex_realty scraper обнаружены при investigating #582 (217 houses без номера дома):
Bug 1 — address терял house number
yandex_realty.py:162-163брал text() только из anchor tag — это была только улица. House number жил в sibling text node parent контейнера.AddressWithGeoLinks__addressContainer--<hash>.Fix: читаем text() parent контейнера + normalise whitespace. Получаем
улица Малышева, 125вместоулица Малышева.Bug 2 — parse_rub() не стрипал NBSP (\xa0)
Yandex SERP форматирует
9\xa0800\xa0000 ₽через non-breaking space (U+00A0). Прежний.replace(" ", "")стрипал только regular space →int("9\xa0800\xa0000")raise ValueError → parse_rub возвращал None → _card_to_lot silently failed.На production main парсилось 0/23 cards из live HTML по этой причине. Это объясняет почему
yandex_realty_nbнакопил так мало houses (305).Fix:
re.sub(r"\s", "", ...)covers NBSP, thin space, tab, etc.Tests
Files
app/services/scrapers/yandex_realty.py+44/-3 (address fix)app/services/scrapers/yandex_helpers.py+6/-2 (NBSP fix)tests/test_yandex_realty_serp.py+91/-4tests/test_yandex_helpers.py+15+156 / -7 net.
Post-deploy verification
yandex_realty_nbhouses имеют address с цифрамиbackfill_house_coords.py(precision filter теперь exact)Refs #582.