Coder Social home page Coder Social logo

guannan / songs-lyrics-web-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aakashbansal/songs-lyrics-web-scraper

0.0 0.0 0.0 236 KB

This is a python script that can scrape lyrics of all the songs by any artist from the web.

Jupyter Notebook 100.00%

songs-lyrics-web-scraper's Introduction

Songs-Lyrics-Web-Scraper

This is a python script that can scrape lyrics of all the songs by any artist from the web.

Description

The project has two files :

  1. Songs Names Scraper.ipynb - This is responsible for creating a json file (Artists-Songs Mapping.json) that would have mapping from artist's name to all its available songs. http://www.song-list.net is used to scrape the songs list.

The artists for which the songs list need to be generated are specified in the artists array :

# artists list whose songs list is to be made
artists = ["edsheeran", "eminem", "taylorswift", "linkinpark", "drake-2"]

Add or remove artists in this array to get the required songs list.

  1. Lyrics Scraper.ipynb - This is responsible for actually fetching (scraping) the lyrics of all songs (specified in Artists-Songs Mapping.json) by a particular artist from web. https://www.azlyrics.com is used to scrape the lyrics.

Specify the artist in the code for which lyrics need to be scraped :

# artist for which the lyrics need to be written
artist = "eminem"
songs = songs_dict[artist]
processed_songs = []

Lyrics are saved in lyrics_scraped.txt

Note

While scraping the web, keep in mind to not just make numerous requests to a website continuosly. It may be entirely possible to overburden the website's servers or you might get blocked, preventing further scraping. Try to scrape the content from web in a way as close as possible to how a normal user would copy and paste, in terms of the time required to gather this content.

To reinforce this, a delay is setup in the code that waits for 10 seconds after fetching one lyric.

songs-lyrics-web-scraper's People

Contributors

aakashbansal 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.