Advertisement
sighting

Lryic Grabber

Jan 2nd, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. from bs4 import @netflooding
  2. import requests
  3.  
  4. print("WELCOME TO MY GENIUS LYRICS FETCHER")
  5. print()
  6.  
  7. print("Enter the artist's name. Caps does not matter")
  8. inputName = input()
  9. #inputName = 'Travis Scott'
  10.  
  11. print("Enter name of song by artist. Song must be exactly same as on Album or Single release. Caps does not matter")
  12. inputSong = input()
  13. #inputSong = 'Sicko Mode'
  14.  
  15.  
  16. for i in range(len(inputName)):
  17. if (inputName[i] == ' '):
  18. inputName = inputName.replace(inputName[i], '-')
  19.  
  20.  
  21. for i in range(len(inputSong)):
  22. if (inputSong[i] == ' '):
  23. inputSong = inputSong.replace(inputSong[i], '-')
  24.  
  25.  
  26. #my_url = 'https://genius.com/Travis-scott-sicko-mode-lyrics'
  27. my_url = 'https://genius.com/' + inputName + '-' + inputSong + '-lyrics'
  28.  
  29. page = requests.get(my_url).text
  30.  
  31. soup = BeautifulSoup(page , 'lxml')
  32.  
  33. lyrics = soup.find('div', class_= "song_body-lyrics")
  34.  
  35. print(lyrics.text)
  36.  
  37. input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement