SHARE
TWEET

koka in rammstein songtexten

DeaD_EyE Jun 1st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import requests_html
  2.  
  3.  
  4. def get_songtexte(band='rammstein_songtexte.html', ending='_rammstein.html'):
  5.     with requests_html.HTMLSession() as session:
  6.         base = 'http://www.songtextemania.com/'
  7.         index = session.get(base + band)
  8.         links = [base + l for l in index.html.links if l.endswith(ending)]
  9.         songs = []
  10.         css_selector = 'html body div#container div#main div#content div.col-left-lyrics div.lyrics-body'
  11.         for link in links:
  12.             songpage = session.get(link)
  13.             for song in songpage.html.find(css_selector):
  14.                 songs.append((link, song.text))
  15.         return songs
  16.  
  17.        
  18. def find(word, songs):
  19.     for url, song in songs:
  20.         if word.lower() in song.lower():
  21.             print(url, song, sep='\n\n')
  22.             print('='*20)
  23.  
  24.  
  25. songs = get_songtexte()
  26. find('koka', songs)
  27.  
  28. # http://www.songtextemania.com//benzin_songtext_rammstein.html
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top