Amazing-Python-Scripts
Youtube Trending Feed Scrapper
It's a 2 scripts that is used to scrap and read the first 10 trending news in YouTube from any its available categories. Let be What's happening right Now
, in Gaming
, in Music
, or in Movies
You will get it on your local machine.
Installation
- Install the following Python libraries:
pip3 install selenium pymongo mongoengine pandas
-
Place ChromeDriver in the same directory of the script. You can download it from here.
(Note: Download the one with the same version of your Chrome browser.) -
Install MongoDB Community Server on your machine. You can refer to the installation from here.
Usage
The scripts allows you to save the scrapped content using 2 methods:
- A MongoDB called
Youtube
and saved in a collection calledtrending
. - A CSV file called
Youtube.csv
.
You can save using either or both, It's up to your desires. The same goes with scrap_reader.py
, It can read from either MongoDB or the CSV file.
- For saving-to/reading-from a MongoDB, pass the
-m
argument. - For saving-to/reading-from a CSV file, pass the
-c
argument.
Output
whatever the used argument to save the data is, it will be saved containing these video attributes:
- Video Section
- Video Title
- Video Link
- Video Channel
- Video Views
- Video Date
Authors
Written by XZANATOL.
The project was built as a contribution during GSSOC'21.