Giter Club home page Giter Club logo

simple-web-scraper's Introduction

simple-web-scraper

Python package

This repository contains code for a webscraper for Lifetime Leaderboards | UMG Gaming Making use of the beatifulsoup4 and requests Postgres as a Database SQLAlchemy is used as a ORM to insert data into the db

Accompanying Blog Post

Get Started with a Web Scraping Project

Installation

  1. Clone this Repo

git clone https://github.com/KenMwaura1/simple-web-scraper

  1. Change into into the simple-web-scraper folder

cd simple-web-scraper

  1. Create a virtualenv

python3 -m virtualenv env

  1. Activate virtualenv

source /bin/activate OR use pipenv pipenv install

  1. Install the required dependecies

python3 -m pip install -r requirements.txt

Database

Ensure Postgres is installed locally and running on port 5432

OR

run a Postgres container on Docker Easy PostgreSQL 10 and pgAdmin 4 Setup with Docker container on port 5432

The default db credentials are:

  • host: localhost
  • port: 5432
  • user: test
  • db: xp_db
  • password: testpassword

Optionally can also set the db credentials as environment variables

export DATABASE_URL='postgres://test:testpassword@localhost:5432/xp_db'

or copy the included .env example file

cp .env.example .env

Add your credentials to the .env file.

Usage

1.Run the scraper

1a. To run the scraper and insert xp data into the db

python xp_scrape.py

1b. To run the scraper and insert earnings data into the db

python earnings_scrape.py

Tests

To run the tests run the following command at the root of the project.

pytest . 

simple-web-scraper's People

Contributors

kenmwaura1 avatar dependabot[bot] avatar dependabot-preview[bot] avatar

Stargazers

 avatar RickyS avatar Roman avatar Martin Ndirangu avatar luda avatar  avatar Hank Lapidez avatar Daniel Santiago Madrigal avatar  avatar

Watchers

James Cloos avatar  avatar Kostas Georgiou avatar

simple-web-scraper's Issues

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.