Docsity

Using Web Scraping to Collect Competitive Market Data: Airbnb Rentals in Helsinki, Slides of Business

Toggle sidebar
bg1
LEVERAGING WEB SCRAPING FOR
COLLECTING COMPETITIVE MARKET DATA
Case: A case study of an Airbnb rental unit in Helsinki
LAB UNIVERSITY OF APPLIED
SCIENCES LTD
Bachelor of Business Administration
Degree programme in Business
Information Technology
Autumn 2020
Thao Ho
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32

Partial preview of the text

Download Using Web Scraping to Collect Competitive Market Data: Airbnb Rentals in Helsinki and more Slides Business in PDF only on Docsity!

LEVERAGING WEB SCRAPING FOR

COLLECTING COMPETITIVE MARKET DATA

Case: A case study of an Airbnb rental unit in Helsinki

LAB UNIVERSITY OF APPLIED SCIENCES LTD Bachelor of Business Administration Degree programme in Business Information Technology Autumn 2020 Thao Ho

Abstract Author(s) Ho, Hoang Phuong Thao Type of publication Bachelor’s thesis Published Autumn 2020 Number of pages 45 Title of publication Leveraging Web Scraping For Collecting Competitive Market Data Case: A case study of an Airbnb rental unit in Helsinki Name of Degree Bachelor of Business Administration Abstract In recent years, web scraping has become a popular technique to gather large amounts of data from many sources. The study focused on the exploration advantages of web scraping in the market re- search process for a small rental business. The business has existing market re- search that still contains several manual steps and limitations inaccuracy. The objec- tive of this thesis was to introduce and examine how web scraping could support a small rental business in the market research process. The research framework for this thesis was a constructive research approach that helped to fill the gap between theo- retical background and practical problem. The definition of web scraping was applied in the market research process, and the implementation process used both qualitative and quantitative research methods. The thesis was carried out within the scope of a small rental business. The research applied qualitative research by having interviews with potential users of the case study, reviewed the existing market research process, and then analyzed the pro- cess's performance with web scraping. The interviews were adopted to collect the views of participants about the web scraper and their feedbacks. By applying web scraping, the author was able to identify the advantages gained in time productivity and efficiency in the market research process. Moreover, the study presented the implementation of a simple web scraper with Python for small rental businesses. The implementation process was reviewed by potential users and ad- justed to meet the case study’s needs better. Keywords web scraping, web scraper, data, market research, Beautiful Soup

  • 1 INTRODUCTION LIST OF ABBREVIATIONS
  • 2 RESEARCH DESIGN
    • 2.1 Thesis motivation
    • 2.2 Research questions
    • 2.3 Research limitations
    • 2.4 Research approach
    • 2.5 Research methods
    • 2.6 Data collection and analysis
    • 2.7 Thesis structure
  • 3 THEORETICAL BACKGROUND
    • 3.1 Description of existing market research
      • 3.1.1 Define objectives
      • 3.1.2 Develop a market research plan
      • 3.1.3 Collect relevant data and information............................................................
      • 3.1.4 Analyze data.................................................................................................
    • 3.2 Introduction to web scraping
    • 3.3 Web scraping components
      • 3.3.1 Crawler
      • 3.3.2 Parse and extract
      • 3.3.3 Format
      • 3.3.4 Storage module
    • 3.4 Web scraping frameworks
      • 3.4.1 BeautifulSoup
      • 3.4.2 Scrapy
      • 3.4.3 Lxml..............................................................................................................
      • 3.4.4 Other frameworks
    • 3.5 Web scraping as a service................................................................................
    • 3.6 Website structure
    • 3.7 Legal Issues
    • 3.8 Web scraping in the market research process
  • 4 IMPLEMENTATION
    • 4.1 Introduction to case study
    • 4.2 Project goals
    • 4.3 Project requirements
    • 4.4 Implementation
      • 4.4.1 Application design
      • 4.4.2 Target objectives
      • 4.4.3 Development process
    • 4.5 Figures of implemented web scraper
    • 4.6 Results and testing
  • 5 COLLECTION OF DATA
    • 5.1 Interview
    • 5.2 Design the structure of the interview.................................................................
    • 5.3 Interview results
  • 6 CONCLUSIONS
    • 6.1 Answering research questions..........................................................................
    • 6.2 Demonstration of web scraping solution working
    • 6.3 Examination of applicability scope
  • 7 SUMMARY
    • 7.1 Reliability and validity
    • 7.2 Suggestions for further development
  • LIST OF REFERENCES
  • APPENDICES..................................................................................................................

LIST OF ABBREVIATIONS

AI – Artificial Intelligence CRA – Constructive Research Approach CSS – Cascading Style Sheets HTML – Hypertext Markup Language URL – Uniform Resource Locator UI – User Interface

2 RESEARCH DESIGN

This chapter presents the research's motivation, research questions, the limita- tions of the study, the research approach, and the structure of the thesis. Also, the data collection and analysis of this thesis are discussed in this chapter. 2.1 Thesis motivation Data analytics is now widely used in various industries, also in the hospitality in- dustry. It is becoming one of the most critical aspects for companies to take a competitive advantage in the market. For instance, from 2013 to 2014, Red Roof Inn, a hotel chain in the United States, could predict flight cancellations and launched an effective marketing campaign by gathering public weather data and flight information. (Bhattacharjee et al. 2017) The hospitality industry includes hotels and relative services with the same con- cept, for example Airbnb could benefit from using web data. There are currently many aggregation websites that offer all information regarding accommodation, such as Tripadvisor.com, Kayak.com, Airbnb.com, and Booking.com. Technology likes web scraping can help business owners gather and analyze data from these sources. Python is considered the most popular programming language for web scraping when it could smoothly handle the data extraction process and provide a wide se- lection of web scraping frameworks (Koshy 2020). Scrapy and BeautifulSoup are two frameworks that are usually chosen to scrape data because of outstanding performance. This thesis reviews existing web scraping frameworks and selects the most suitable framework for creating the case study's web scraper application. 2.2 Research questions The thesis discusses the traditional market research of rental businesses, then finds some effective ways to increase the efficiency of the process. The primary goal of this thesis is to explore the advantages of web scraping to the market re- search process through a case study of building a web scraping application for Airbnb hosts to collect data in the market. In specific, collecting competitors’ data

is helpful for one business owner to adjust the price, improve the customer experi- ence as well as marketing campaign planning. This research aims to create a so- lution for the case study by answering the main research question as stated below:

  • How can the web scraping technologies support the market research process for rental property business? In order to solve the main research question and provide an easy-to-follow path for the research, sub-research questions have been formulated:
  • How does the existing market research process of the case study look like?
  • How does a web scraper service help to collect competitive market data?
  • What are the stages of building a simple web scraper as a service? The first question aims at reviewing the current market research, its process, and existing problems for the case study. The second question explores how one web scraper works and how to apply web scraping to extract competitive data from public sources. Based on the case study’s requirements and together with the the- oretical background, the third question finds out needed steps to create a web scraping as a service from scratch with the programming language. With the web scraper built for the case study, the research may apply the solution to the existing process and detect benefits that web scraping can support the market research process for rental property businesses. Currently, there are different available technologies of web scraping that could be applied in business models. The functions and capabilities of web scraping tools depend on business requirements. Emerson (2019) defines some of the potential web scraping tools that could be applied in the market research process:
  • Browser plug-in tools: Plug-ins could be installed and used directly in browsers such as Chrome, Firefox, Microsoft Edge. However, these tools require manual works from users that will select the location of information that they want to scrape.

2.4 Research approach This thesis aims to apply web scraping technologies in the market research pro- cess to gather data for Airbnb hosts. Hence, the author decided to implement a constructive research method that is used to fill the gap between academic theory and practical problems. An alternative to a constructive research approach could be design science re- search, but as CRA includes market testing in the implementation stage (Lind- holm, 2008), CRA was chosen. Kasanen (1993) presents that the constructive re- search approach should always start with a practical research problem and be fol- lowed by the below steps:

  1. Obtain the necessary knowledge of the study field.
  2. Develop applicable solution ideas for the problem.
  3. Implement the solution idea and test its feasibility.
  4. Demonstrate the relationship between the theoretical foundation and solu- tion contribution.
  5. Evaluate the applicable results. According to Pasian (2015), neither deductive nor inductive reasoning could cover the constructive research approach fully. Therefore, abductive reasoning is used to replace inductive and deductive processes by adopting a pragmatist perspec- tive. Image 1 describes the formulation of the abductive reasoning approach.

In this paper, the thesis starts with reviewing existing web scraping frameworks, then develops and tests these options to build a scraper for a case study that was mentioned in the thesis motivation part. As several concerns arise during the study case, abductive is used to explain these redirections. Following the abductive rea- soning approach, the research aims to evaluate applicable results as well as re- flect on the relationship between theories and practical work. 2.5 Research methods There are three main research methods to demonstrate the solution in the con- structive research approach: qualitative research, quantitative research, or the combination of two of them. (Oyegoke 2011) There are two common research methodologies: qualitative and quantitative. They depend on ways of collecting data and analysis as well as they help to answer dif- ferent kinds of research questions. Qualitative research is presented under words to understand single concepts or phenomena, and interviews play an important role in executing this research method. Miles and Huberman (1994) also mention that qualitative research provides relevant ways to draw conclusions and verify it. Image 1 The formulation of abductive reasoning approach (Samim 2020)

gather the user’s opinions on the implementation of web scraping to the market re- search process. The interview section consists of different open-ended questions that require specific responses. Therefore, the qualitative research method was adopted to collect and analyze these open-ended questions. Also, the quantitative research method was applied to compare the performance of the existing market process and the new one with web scraping. The performance could be estimated based on data volume, time, and speed. These collected data aimed to help an- swer the thesis’ research questions and provided ideas to improve the case study. 2.7 Thesis structure Figure 1 presents the structure of this thesis. The thesis is divided into six chap- ters. In Chapter 1, the thesis introduces the topic and research background. Chap- ter 2 demonstrates the motivation why the thesis is conducted, identifies the main objectives, and the foundation of research questions. Also, the research approach, research method, data collection, and the limitations of this study are explained in this chapter. Next, Chapter 3 explores the theory of the research. This section fo- cuses on web scraping, its framework (Scrapy and BeautifulSoup), and legal is- sues. These information helps build the theoretical foundation of how web scrap- ing could support the market search process for small rental businesses. Chapter

Introduction

Research

Design

Theoretical

Background

Summary Conclusion Implementation

Figure 1. Thesis Structure

4 shows the case study, the implementation, the result, and explains how the per- formance of the implementation could help answer research questions. Chapter 5 presents the data collection as well as presents the results of the analysis. Chap- ter 6 finalizes the whole research and answers initial research questions. At the end of this chapter, several suggestions for further development are also given. Chapter 7 summarizes the whole research and provides research conclusions.

problem, defines specific research approaches, required data, sampling plans, the budget for the research, and how the results support the decision-making. 3.1.3 Collect relevant data and information This is the core of the market research, which is used to collect data through pub- lic sources, surveys, conducting interviews, field testing, etc. Most of the collected data will be answers, choices, observations that are then stored in spreadsheet format for further analysis (Market Research Guy 2020). The collection of data plays an important role in decisions that businesses will make later. However, it will take a lot of time if one business wants to extract a large amount of competi- tors’ data from public sources by copying and pasting data manually. 3.1.4 Analyze data After gathering all relevant data, the last step aims to make the collected data speak through structured tables, visualizations with the help of Excel or business intelligence tools such as Power BI, Tableau, Google Analytics. Analyzing data aims to look for trends of the market, specific conclusions that support the last de- cision. 3.2 Introduction to web scraping Web Scraping is known as a technique used to extract data from multiple sources to simple flat files or databases that make further analysis and visualization easier (Sirisuriya 2015, 135). In the past, the only method to collect data from websites is copy-and-paste data manually. Good practical examples of web scraping could be competitive market research, price intelligence, and content monitoring. Web scraping is also known as web harvesting, web data extraction or web data mining can be defined as a technique used to extract data from websites through an automated process. In other words, this process aims to copy data automati- cally from websites and deliver them to a database that could be structured or un- structured database. Generally, web scraping could be executed by writing an au- tomated program which is a web scraper. The web scraper queries a web server and request data under format like HTML and XML format, then parses that data to extract needed information. Figure 3 illustrates the structure of the web scraping

process. Web scraping has been a popular technique in the business world that includes not only big corporations but also startups. As data is a priceless asset for compa- nies and organizations, web scraping allows the business owner to quickly gather vast amounts of data from online sources. This is the core of the market research and business strategy, for instance, gathering product reviews, social networking posts, or comparing competitive prices. 3.3 Web scraping components There are four main components included in the web scraping: Crawler; Parse and Extract; Format; and Storage Module. Figure 4 presents how web scraping’s com- ponents are used in the scraping process under simple steps. Targeted Websites (HTML Page) Web Scraping Technique Structured Data Figure 3. Web scraping process Crawler – Document Load Parsing and Extraction Format Storage Figure 4. Web scraping working flow

Scrapy (Python), BeautifuSoup (Python), Goutte (PHP), etc. In this section, the thesis focuses on discussing Scrapy, BeautifulSoup, and how they can be applied in variety situations. 3.4.1 BeautifulSoup BeautifulSoup is a pure open-source Python library developed by Leonard Rich- ardson, which is mainly used for HTML and XML file parsing. It provides methods to search elements and extract structured data from a website and saves program- mers a lot of time since it could collaborate with common parsers such as lxml or html 5 lib to provide a solution to navigate, search and modify the parse tree. Beautiful Soup is a more streamlined version than its brother, which is Scrapy and could be used for simpler web scraping projects. It can parse HTML and XML doc- uments and bring simple methods to work with DOM (Document Object Model). In addition, Beautiful Soup has the capacity of exporting fetched documents to Unicode or UTF-8. 3.4.2 Scrapy Scrapy is a web scraping framework for Python and useful for various of purposes such as data mining, information processing, or historical archival. Scrapy is more powerful than Beautiful Soup as it is usually used for large scale web scraping. Scrapy offers a complete package for downloading web pages, processing inside content, and converting to readable files or databases. Developing web scraper with Scrapy is quite easy to follow, the important thing is to create the parse() func- tion to deal with downloaded data and return scraped data. 3.4.3 Lxml Lxml is a Python library and is one of the fastest libraries for processing XML and HTML. This library is built on top of the libxml2 XML parsing library written in C which combines the speed of the native C library and the simplicity of Python (Fatenaite 2020). Python lxml can be used to create XML and HTML documents, find specific elements.

3.4.4 Other frameworks Selenium In the beginning, Selenium is widely used for website testing (Mottet 2018). Also, this library could be used as a web scraping library and allows users to control a web browser and automate different events such as clicking and scrolling. While Scrapy or Requests cannot work well with websites written in JavaScript, Sele- nium has good performances with JavaScript events and can control web brows- ers such as Chrome, Safari, or Firefox by combining with WebDriver protocol. 3.5 Web scraping as a service Web scraping as a service is a term for executing the data extraction without re- quired coding knowledge. From big corporations to startups and tiny businesses, web scraping as a service provides several solutions such as price tracking, social media monitoring, information aggregation. The service allows users to collect data from online sources within a few clicks in the same way as using softwares. Some of the common web scraping services are Octoparse.com, Parsehub.com, and Scrapinghub.com. One of the big limitations of web scraping service is pricing. The cost depends on the numbers of websites to be scraped, complexity, frequency of scraping, mainte- nance as well as customer support service. While big companies could consider web scraping service to be a good option to replace humans, small businesses need to work on the budget. For these reasons, this thesis aims to create a simple web scraper self-service that shares the difficulties with small businesses in the hospitality industry. 3.6 Website structure Web scraping approaches depend on website structures. Websites store data in two main ways that are Hypertext Markup Language (HTML) elements and Appli- cation Programming Interface (API). Hypertext Markup Language (HTML) Hypertext Markup Language (HTML) could be seen as a backbone that describes