We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Div missing when converting HTML to XLSX

I am converting HTML to XLSX using the following Java code:

public static void main(String[] args)
{
try
{
com.aspose.cells.License license = new com.aspose.cells.License();
license.setLicense( “d:\CC\Sandbox\Aspose.Total.Java.lic” );
Workbook workbook = new Workbook(“d:\CC\Sandbox\excel3.html”, new LoadOptions(LoadFormat.HTML));
workbook.save(“d:\CC\Sandbox\excel3.xlsx”);
System.out.println( workbook.getFileName() );
}
catch (Exception e)
{
System.out.println( e.getMessage());
}
}

This is the HTML that I try to convert:
<html>
<body>
<div>This is line 1</div>
<div>This is line 2</div>
<div>This is line 3</div>
<div>This is line 4</div>
<div>This is line 5</div>
</body>
</html>

In the resulting XLSX the second <div> containing the text “This is line 2” is missing.

Regards,
Wim Roeling
ADP, Amsterdam
The Netherlands

@wroeling,

Please try our latest version/fix: Aspose.Cells for Java v19.11.7.
aspose-cells-19.11.7.zip (6.7 MB)

I have tested your scenario/ case with v19.11.7 and it works fine. The output XLSX file contains all the rows.

Let us know your feedback.