I am using python to download and save an xlsx file from the web using a url. Next, I am using python code to convert to sqlite (.db). The problem is that the xlsx file is not being converted into a db file. But when I manually open the xlsx file and hit the save button then use python to convert that xlsx file to a db file it works. It seems like the file is not being downloaded correctly??
Thank you for the help!
def download_and_save_data(url, filename_response):
retrieve(url, filename_response+'.xlsx')
def convert_xlsx2db(filename_response):
con=sqlite3.connect(filename_response+".db")
wb=pd.read_excel(filename_response+'.xlsx', sheet_name='Data', engine='openpyxl')
wb.to_sql(filename_response, con=con, if_exists="replace")
con.close()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…