Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranjan Paudel Task4: IMDb Scraper (Flask App) #26

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

mrranjan31paudel
Copy link
Contributor

@mrranjan31paudel mrranjan31paudel commented Nov 30, 2020

IMDb Scraper: A Flask App

Simple Server-side-rendering web-app(Python) in Flask. An authorized user can scrape (or update the scraped data of) four IMDb pages:
Top Rated Movies
Most Popular Movies
Top Rated TV Shows
Most Popular TV Shows

Install

Clone the repo.

# clone this repo
$ git clone https://github.com/mrranjan31paudel/lf-training.git
$ cd Python/RanjanPaudel/scraper

Create a virtual environment and activate it. (Recommended)

$ python3 -m venv scraper_app_venv
$ source scraper_app_venv/bin/activate

----Or in Windows cmd----
$ scraper_app_venv\Scripts\activate.bat

Install packages from requrements.txt.

$ python3 -m pip install -r requirements.txt

Setup

Install mysql in your system (Follow this guide).
After the installation is complete, copy .env.example as .env:

$ cp .env.example .env

Then set the parameters as per your requirement.
To run the migrations, first create database scraper_app for development and scraper_app_test for test. Then use the simple migrating CLI app:

$ python3 scraper_app/db_migrator.py --env {test|development} --action {create|drop}

You can use: $ python3 scraper_app/db_migrator.py --help for detailed info about the CLI migrator-app.

Run

Mode: Development

In the terminal do:

$ export FLASK_ENV=development
$ export FLASK_APP=scraper_app/app.py
$ flask run

Mode: Test

This is used to perform the unit-tests in the /tests folder. For this you just have to do:

$ pytest -s
#'-s' to show the logs of test passings.

Some screenshots

Screenshot-1
Screenshot-2
Screenshot-3
Screenshot-4
Screenshot-5
Screenshot-6
Screenshot-7
Screenshot-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant