What is the best way to convert HTML to Excel?

I have an HTML page with a flash diagram (FusionCharts) and an HTML table. I need to convert all this to Excel. The HTML table should appear in the cells of the excel sheet. Flash chart can be displayed as an image.

Is there any open source API we could use to achieve this. Could you tell me what are the possible options.

Is it possible to do this using only javascript.

+3
source share
7 answers

HTML table is relatively simple. You can load the page, parse the HTML (various HTML parsing libraries are available), extract the table and convert it to CSV (which Excel can load), or directly create an Excel file, for example. using Java POI as suggested above.

The flash part is much more complicated. There are many tools to capture flash memory for an image; you will need to use one of them. This can be tricky because Flash can be interactive, so you may need to remotely control part of Flash so that it displays the correct image before capturing. It is hard to say without additional information.

, ( , ) . , .

+5

"application/vnd.ms-excel". html- - , excel . .

application/excel
application/vnd.ms-excel
application/x-excel
application/x-msexcel
+4

Excel HTML . - HTML XLS. Excel XLS, .

+3

Java POI api, , Java. http://poi.apache.org/

Win32, Excel COM api, .

+2

- Flash, HTML Excel. , Excel HTML-, HTML , , .

CPAN HTML::TableExtract - , , , , . , , , , , . , , , , - .

, Excel Spreadsheet::WriteExcel, OLE. , , Excel , .

, , Excel ( CSV). , , .

Excel -.

, ( ..), Perl .

+2

, , . csv . , , - - HTML, (, , - , ).

CSV (.. ) Excel .

+1

SpliFF, , CSV, mime application/vnd.ms-excel, Excel

+1

Source: https://habr.com/ru/post/1710141/


All Articles