Use pasted Booking.com search URL to pin scrape destination

The location_search_url column existed but was dead — the scraper always
rebuilt the URL from the free-text location name. Now the Location
Configuration form takes a "Booking.com search URL" field: paste the
address-bar URL from a real search and the scraper lifts ss/dest_id/
dest_type from it (the most reliable destination pin). Falls back to
dest_id, then plain name. Server also extracts dest_id from the URL for
the column and derives a display name from ss when none is typed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-05 22:00:28 +00:00
parent 9e5728efb1
commit 579a189cb8
5 changed files with 97 additions and 24 deletions

View file

@ -91,7 +91,8 @@ class ScraperBackend(ABC):
check_out: date,
adults: int = 2,
pages: int = 2,
dest_id: Optional[str] = None
dest_id: Optional[str] = None,
search_url: Optional[str] = None
) -> ScraperResult:
"""
Scrape booking.com location search results.
@ -105,6 +106,8 @@ class ScraperBackend(ABC):
dest_id: Booking.com numeric destination id. Pins the search to one
destination free-text ss= resolves non-deterministically
(Stow on the Wold intermittently matched St. Wolfgang, Austria)
search_url: A pasted Booking.com search URL whose ss/dest_id/
dest_type pin the destination (wins over dest_id/location)
Returns:
ScraperResult with hotels and rates found