Giter VIP home page Giter VIP logo

webscraper_sophie's Introduction

Webscraper for Sophie ๐Ÿœ

This is a small webscraper application, which I wrote to do a market research on the condo prices in my hometown ๐Ÿ  (Graz, Styria, Austria).

The webscraper crawls the Willhaben website, extracts the relevant data and stores it in a local database as shown in the following figure:

website data is extracted and stored in DB

The data can be used in various ways. I did a small market research in Tableau, which is not included in this project, but I'd like to provide a teaser of the results: ๐Ÿ“ˆ

results results

Prerequisites

Make sure Docker-Compose is installed on your machine. See Install Docker Compose

Note for Ubuntu users:

  1. Install Docker as descriped here
  2. Do the post install steps
  3. Install Docker-Compose as descriped here

๐Ÿš€ Usage

The docker-compose.yml file will start two docker containers (one for the webscraper and one for the MySQL database) and can be used like this:

  1. Open a new terminal window and type the following commands
git clone https://github.com/michaelhaar/webscraper_sophie.git

# cd into the repository
cd webscraper_sophie
  1. Build the containers. The following command will download the base images (Python + MySQL) from the internet and install some packages inside the webscraper container.
docker-compose build		# may take a few minutes
  1. We can start the containers and immediately run the webscraper application with
docker-compose up			# starts the docker containers
  1. Verify that the webscraper is working properly by viewing the output of the webscraper in the terminal window. It should print out the extracted items.

Note: It's very likely that the webscraper application isn't working anymore because willhaben changes the HTML of their website from time to time. Please feel free to contact me or create a new issue if you need something.

  1. Access the results, which were extracted and then inserted into the database. You can use your favorite MySQL Client for this step. (I'm using DataGrip).
  • host=localhost
  • port=3306
  • The login credentials can be found in the .env file.

Hints

The following commands might be useful

# Build the docker containers
docker-compose build

# Start the docker containers
docker-compose up

# Bash into the webscraper container
docker-compose run --rm webscraper bash

# Manually start the webscraper application,
# when bashed into the webscraper container
scrapy crawl willhaben

# Re-build PIP requirements
docker-compose run --rm webscraper pip-compile requirements/requirements.in

Author

๐Ÿ‘ค Michael Haar

webscraper_sophie's People

Contributors

michaelhaar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.