karaoqueue/helpers.py
2019-05-21 01:06:59 +02:00

17 lines
383 B
Python

import requests
from bs4 import BeautifulSoup
def get_catalog_url():
r = requests.get('https://www.karafun.de/karaoke-song-list.html')
soup = BeautifulSoup(r.content, 'html.parser')
url = soup.findAll('a', href=True, text='CSV')[0]['href']
return url
def get_songs(url):
r = requests.get(url)
return r.text
if __name__ == "__main__":
print(get_songs)