fix: use structural selectors for DDG weather advisory handling #65
Reference in New Issue
Block a user
Delete Branch "fix/weather-advisory-selectors"
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
div:first-child,div:nth-child(2)) with structural ones (div:not(:has(ul)),div:has(> ul)) so the weather extractor works when DuckDuckGo inserts advisory banners (e.g. wind advisory for Erie, PA)TestExtractWeather_WithAdvisorytest case verifying extraction succeeds with an advisory div presentRoot Cause
The hourly container was located with
div:nth-child(2), which breaks when an advisory banner inserts an extradivbefore it. The weekly forecast was unaffected because it already used the structural selectorul > div.Test Plan
TestExtractWeather_WithAdvisorytest passesgo test ./...passesFixes #64