koka in rammstein songtexten
DeaD_EyE Jun 1st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import requests_html
- def get_songtexte(band='rammstein_songtexte.html', ending='_rammstein.html'):
- with requests_html.HTMLSession() as session:
- base = 'http://www.songtextemania.com/'
- index = session.get(base + band)
- links = [base + l for l in index.html.links if l.endswith(ending)]
- songs = 
- css_selector = 'html body div#container div#main div#content div.col-left-lyrics div.lyrics-body'
- for link in links:
- songpage = session.get(link)
- for song in songpage.html.find(css_selector):
- songs.append((link, song.text))
- return songs
- def find(word, songs):
- for url, song in songs:
- if word.lower() in song.lower():
- print(url, song, sep='\n\n')
- songs = get_songtexte()
- find('koka', songs)
- # http://www.songtextemania.com//benzin_songtext_rammstein.html
RAW Paste Data