Open jumpjack opened 2 years ago
Assign the result to "h" to get a simplified list:
h.b_hotels.forEach((hotel) => {console.log(hotel.b_hotel_title, hotel.b_accommodation_type, hotel.b_review_score + "(" + hotel.b_review_nr + ")" , hotel.b_marker_type , hotel.b_u_total_price, "dist=" + (Math.sqrt(Math.pow(centerlat*1-hotel.b_latitude,2) + Math.pow(centerlon*1-hotel.b_longitude,2))*111).toFixed(0)) });
From hotel.b_marker_type you can understand if location is available or not; if it is, also its price (hotel.b_u_total_price) is available.
Given this value for "boundin box" (BBOX):
bbox="13.673105411340503,41.75777869190572,14.244394473840503,42.36949079906152"
You can get center value by:
coords=bbox.split(",");
lat1=coords[1]*1;
lon1=coords[0]*1;
lat2=coords[3]*1;
lon2=coords[2]*1;
centerlat = lat1 + (lat2-lat1)/2;
centerlon = lon1 + (lon2-lon1)/2;
And hotel distance from center by:
Math.sqrt(Math.pow(centerlat*1-h.b_hotels[HOTEL_NUM].b_latitude,2) + Math.pow(centerlon*1-h.b_hotels[HOTEL_NUM].b_longitude,2))*111
It does not work (anymore?), but this script works in extracting data from html results:
https://www.booking.com/searchresults.it.html?checkin_month=11&checkin_monthday=9&checkin_year=2022&checkout_month=11&checkout_monthday=11&checkout_year=2022&group_adults=3&group_children=0&order=price&ss=Rome%2C%20Italy&offset=26&nflt=mealplan%3D1%3Boos%3D1%3Breview_score%3D80
Additional filters: Use &nflt= followed by a string of "parameter%3dvalue" , each parameter separated by %3b (=";"); example: &nflt=mealplan%3D1%3Boos%3D1%3Breview_score%3D80