I finally got it to create the csv file but for some reason it creates the headers but never fills in the data
import requests
from bs4 import BeautifulSoup
import csv
url = "http://www.scsotx.org/jail-booking"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html5lib')
inmate_data =[]
table = soup.find('div', attrs = {'class':'sex-offender-info'})
for row in table.findAll('div', attrs = {'class':'jail-content'}):
jaildata = {}
jaildata['Name'] = row.h4.text
jaildata['Agency'] = row.p.text
inmate_data.append(jail-content)
with open('C:\\Users\Cale\Desktop\jail\inmate_data.csv', 'w') as f:
w = csv.DictWriter(f,['Name','Agency'])
w.writeheader()
for jaildata in inmate_data:
w.writerow(jaildata)
its supposed to parse the html data and then append the csv file