0

I have a bunch of purchase orders in .html formats that I need to extract data and put in one simple excel sheet. While I could use beutifulsoup to do it I would rather just use excel's in built converter which already does a much better job. Then just work with excel files directly. Is there a way to use python to open html documents, then save it again in .xlsx. I tried using openpyxl but it does not take html files.

1 Answer 1

0

You could use Python to automate an instance of the Excel application, opening each file, and saving as .xlsx:

import win32com.client
excelApp = win32com.client.Dispatch('Excel.Application')
book = excelApp.Open(path_to_html_file)
book.SaveAs(path_to_html_file + '.xlsx', 51)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.