from bs4 import BeautifulSoup
import csv
HOST = '
alegeri.md'
CSV = 'file.csv'
with open("index.html", "r") as f:
contents = f.read()
soup = BeautifulSoup(contents, 'lxml')
items = soup.find_all('tbody')
for i in range(1, 33):
wtf = soup.find_all('td', attrs={"data-sort-value": i})
wtf_s = soup.find('div', class_="rphoto").find('img').get('src')
wtf_ss = soup.find_all('td', class_='grey')
file = []
# w = soup.find('td', attrs={"data-sort-value": i}).find('div', class_="rphoto").find('img').get('src')
print(wtf)
print(wtf_s)
print(wtf_ss)
# print(w)
f = open('file.csv', 'w')
f.write([file])
f.close()
# with open('file.csv', mode='w') as file_csv:
# fieldnames = ['wtf', 'wtf_s', 'wtf_ss']
# writer = csv.DictWriter(file_csv, fieldnames=fieldnames)
#
# writer.writeheader()
# writer.writerow({'wtf': 'soup.find_all', 'wtf_s': 'soup.find', 'wtf_ss': 'soup.find_all'})