#! /usr/bin/env python3

import configparser
import glob
import requests
import re
from bs4 import BeautifulSoup

def scrape():
    data = []
    page = requests.get('http://www.95bfm.com/top10')
    soup = BeautifulSoup(page.text, 'lxml')
    table = soup.find('table', attrs={'class': re.compile(r"views-table.*")})
    table_body = table.find('tbody')

    rows = table_body.find_all('tr')
    for row in rows:
        cols = row.find_all('td')
        cols = [ele.text.strip() for ele in cols]
        data.append([ele for ele in cols if ele]) 

    return data

print(scrape())

config = configparser.ConfigParser()
for fname in glob.glob('*.properties'):
    if (fname != 'example.properties'):
        config.read(fname)
        break

print(config.sections())
print(config['default']['client_id'])
print(config['default']['client_secret'])
