Pretvori HTML tablicu iz datoteke u .CSV tablicu u datoteci
python.py
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import pandas as pd
with open("datoteka.html", "r", encoding="utf-8") as file:
html_content = file.read()
soup = BeautifulSoup(html_content, 'html.parser')
table = soup.find('table', {'class': 'screener_table'})
df = pd.read_html(str(table))[0]
df.to_csv('datoteka.csv', index=False)
print("*** le Kraj ***")
html2csv table2csv htmltable2csv csv xhtml2csv xtable2csv xhtmltable2csv xcsv <html> <table>