Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A quick and easy tutorial to scrape data from Booking.com based on parameters destination, date, budget, star rating, and distance from city center.
{
"_id":"booking",
"startUrl":[
"https://www.booking.com/searchresults.html?aid=1508980&sid=ee7c661a3ec2420db360347075d64079&tmpl=searchresults&checkin_month=6&checkin_monthday=4&checkin_year=2019&checkout_month=6&checkout_monthday=7&checkout_year=2019&city=20015725&class_interval=1&dest_id=20015725&dest_type=city&from_sf=1&group_adults=2&group_children=0&label_click=undef&no_rooms=1&raw_dest_type=city&room1=A%2CA&sb_price_type=total&shw_aparth=1&slp_r_match=0&src=searchresults&srpvid=4f694ca313d60042&ss=San%20Diego&ssb=empty&ssne=San%20Diego&ssne_untouched=San%20Diego&nflt=pri%3D2%3B&rsf="
],
"selectors":[
{
"id":"product listing",
"type":"SelectorElement",
"parentSelectors":[
"_root",
"link"
],
"selector":"div.sr_item:nth-of-type(n+2)",
"multiple":true,
"delay":0
},
{
"id":"property_name",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"span.sr-hotel__name",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"property_location",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"a.jq_tooltip",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"property_star_rating",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"i.bk-icon-wrapper",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"top_review",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"div.bui-review-score__title",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"number_of_reviews",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"div.bui-review-score__text",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"customer_rating",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"div.bui-review-score__badge",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"type_of_room",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"strong",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"property_demand",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"span.only_x_left",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"price",
"type":"SelectorText",
"parentSelectors":[
"product listing"
],
"selector":"div.bui-price-display__value",
"multiple":false,
"regex":"",
"delay":0
},
{
"id":"link",
"type":"SelectorLink",
"parentSelectors":[
"_root",
"link"
],
"selector":"a.paging-next",
"multiple":false,
"delay":0
},
{
"id":"property_website_link",
"type":"SelectorLink",
"parentSelectors":[
"product listing"
],
"selector":"a.hotel_name_link",
"multiple":false,
"delay":0
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment