url = (
    """http://www.nse.com.ng/Issuers-section/corporate-disclosures/corporate-actions/closure-of-register"""
    )
soup = BeautifulSoup(requests.get(url).content, 'html.parser')
rows = soup.select('table.ms-rteTable-default tr')
headers = [header.get_text(strip=True).encode('utf-8') for header in rows[0
    ].find_all('td')]
data = [dict(zip(headers, [cell.get_text(strip=True).encode('utf-8') for
    cell in row.find_all('td')])) for row in rows[1:]]
pprint(data)
with open('sara.csv', 'wb') as csvfile:
    spamwriter = csv.DictWriter(csvfile, headers, delimiter='\t', quotechar
        ='\n')
for row in data:
    spamwriter.writerow(row)
Get content of table in BeautifulSoup