{"id":1379,"date":"2022-09-04T04:33:22","date_gmt":"2022-09-04T04:33:22","guid":{"rendered":"https:\/\/www.webharvy.com\/blog\/?p=1379"},"modified":"2022-09-04T04:33:23","modified_gmt":"2022-09-04T04:33:23","slug":"web-scraping-google-hotels-search-results","status":"publish","type":"post","link":"https:\/\/www.webharvy.com\/blog\/web-scraping-google-hotels-search-results\/","title":{"rendered":"Web Scraping Google Hotels Search Results"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hotel search on Google helps you discover and compare top rated hotels at all locations around the world. It provides details like hotel name, address, rating, price, reviews, amenities and other hotel details, website address, phone number etc. In this article we will learn the process of web scraping hotel details from <a href=\"https:\/\/www.google.com\/travel\/hotels\">Google Hotel Search<\/a>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Download &amp; Install WebHarvy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A <a href=\"https:\/\/www.webharvy.com\/articles\/what-is-web-scraping.html\">Web Scraper<\/a> is a software which automates the process of extracting (copy pasting) data from websites. <a href=\"https:\/\/www.webharvy.com\/\">WebHarvy<\/a> is an easy-to-use yet powerful, virtual web scraper which can be used to scrape data from any website. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may <a href=\"https:\/\/www.webharvy.com\/download.html\">download and install<\/a> the free trial version of WebHarvy in your computer by following the instructions given in our <a href=\"https:\/\/www.webharvy.com\/articles\/getting-started.html\">getting started guide<\/a>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WebHarvy contains a built-in web browser using which you can load websites and <a href=\"https:\/\/www.webharvy.com\/demo.html\">select data by directly clicking over them<\/a>. WebHarvy allows you to follow links and scrape data from multiple pages of listings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to follow to scrape data from Google Hotels<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The video displayed below shows the steps which you need to follow to scrape hotel details from Google Hotels Search. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Scraping Hotel Details from Google Travel  | Name, Address, Phone, Website, Rating, Amneties etc.\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/Yf90pR2umq8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are 2 <a href=\"https:\/\/www.webharvy.com\/tour1.html#RunScript\">JavaScript codes <\/a>used in the above method. They can be found by <a href=\"https:\/\/gist.github.com\/sysnucleus\/aab5fbd2a208eae1e77e6920f0412e50\">following this link<\/a>. They are required for the following purposes. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Google Hotels search results load more data as the user scroll down the page. To simulate this action, so that we can scrape data from multiple pages of hotel results listings, the first JavaScript code is used.<\/li><li>After loading multiple pages, the listings are not placed within a single layer\/level in the source code of the page, rather they are nested. This makes it difficult for scrapers to identify multiple hotel results looking at the HTML source of the page. To overcome this and to flatten the nested hotel listings, the second JavaScript code is used. <\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Have Questions or Need Support?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have any questions or need support in configuring WebHarvy please do not hesitate to contact our <a href=\"https:\/\/www.webharvy.com\/support.html\">technical support<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hotel search on Google helps you discover and compare top rated hotels at all locations around the world. It provides details like hotel name, address, rating, price, reviews, amenities and other hotel details, website address, phone number etc. In this article we will learn the process of web scraping hotel details from Google Hotel Search. &#8230; <a title=\"Web Scraping Google Hotels Search Results\" class=\"read-more\" href=\"https:\/\/www.webharvy.com\/blog\/web-scraping-google-hotels-search-results\/\" aria-label=\"Read more about Web Scraping Google Hotels Search Results\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1379","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/posts\/1379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/comments?post=1379"}],"version-history":[{"count":1,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions"}],"predecessor-version":[{"id":1380,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions\/1380"}],"wp:attachment":[{"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/media?parent=1379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/categories?post=1379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webharvy.com\/blog\/wp-json\/wp\/v2\/tags?post=1379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}