/Lyrics-Scraping

Crawler programmed to navigate the website, parse, and scrape relevant lyrics of all the artists using the Scrapy Module.

Primary LanguageHTMLMIT LicenseMIT

===========================================================================

Lyrics Scraping

! Work in Progress... !



Project Organization


──────────────────────────────────────────────────────────────────────────────────────────
|
├── LICENSE		# MIT License.
|
|                         		
├── README.md		# The top-level README for developers using this project.
|
|
├── files		# Contains related project files. 
│                          		
│
├── requirements.txt	# Requirements file for reproducing the analysis environment.
│                         			
│                         		
├── setup.py		# Makes project pip installable (pip install -e .), so source folder can be imported.
│                         			
│  
├── lyrics_crawler	# Source code for use in the project.
│   │
│   ├── __init__.py	# Makes 'lyrics_crawler' a Python module.
│   │
│   │
│   ├── lyrics_crawler	# Primary Scrapy hierarchy.
│   │             │
│   │             ├── __init__.py		
│   │             │
│   │             ├── spiders		# Folder which holds the spider scripts.
│   │             │          └── __init__.py	
│   │             │          └── _xp_01.py	# Spider for testing a basic Crawling procedure.
│   │             │
│   │             ├── items.py		# Item containers.
│   │             │
│   │             ├── middlewares.py	# Middleware Settings.
│   │             │
│   │             ├── pipelines.py	# Database Connection.
│   │             │
│   │             └── settings.py	# Scrapy Settings such as Proxies, User Agents, etc.
│   │
│   │
│   ├── Lyrics_Scraping.egg-info        # Contains additional package information.
│   │
│   │
│   └── scrapy.cfg	# Scrapy Configuration File.
│  
└─────────────────────────────────────────────────────────────────────────────────────────



Package Installation

◘ Requirements

  • setuptools~=68.1.0
  • scrapy~=2.10.0

◘ Software Specification

  • Python~=3.11.3
  • PyCharm IDE 2023.1
  • Notepad++ v6.9.2

◘ Library Installation (using pip)

In order to install the required packages on the local machine, Open pip and run the following commands separately:

> pip install scrapy                            

◘ Module Installation (setup.py)

  1. To use the setup.py file in Python, the first objective is to have the setuptools module installed. It can be accomplished by running the following command:
pip install setuptools                                     
  1. Once the setuptools module is installed, use the setup.py file to build and distribute the Python package by running the following command:
python setup.py sdist bdist_wheel

If any error is encountered, then run python setup.py sdist

  1. In order to install all the requirements, run the following command:
pip install .                                 

◘ Representation of the Scrapy Architecture

alt text


◘ Executing the Spider scripts

  1. Open the project inside any IDE, then use its terminal to access the Scrapy Project by running the following command:
> cd lyrics_crawler
  1. Finally, initiate the crawling process by executing the spider:
> scrapy crawl spiderName

where spiderName is the name declared inside the spider script.


◘ Supplementary Resources

For more details, visit the following links:



License

◘ MIT License

Copyright (c) 2023 Shahriar Rahman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


===========================================================================