-1

I have an html file with several tables that contain inputs, I want to place each table in an Excel sheet. The problem is that the result is an Excel file with no inputs entered by the user

this my code :

testml = (r'http://127.0.0.1:5000')
dfhtml = pd.read_html(testml) 
with ExcelWriter('test_name_file.xlsx') as writer:
   dfhtml[0].to_excel(writer,'sheet1')
   dfhtml[1].to_excel(writer,'sheet_2')
   dfhtml[2].to_excel(writer,'sheet_3')
   dfhtml[3].to_excel(writer,'sheet_4')
   dfhtml[4].to_excel(writer,'sheet_5')
   writer.save()
return render_template('index.html')
oum
  • 9
  • 2

1 Answers1

0

When you read your html from 'http://127.0.0.1:5000', it's like you've opened a new tab in a browser with that url. You are getting the empty forms or whatever you have there. No way for the user input to get there.

What you need is to send user input to server, using form action, save it into file or DB or something and then to read it from there. There is no way to get input from page displayed in user's browser except by sending it to server.