How to Export Html table from web application.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2012
11:08 PM
06-14-2012
11:08 PM
How to Export Html table from web application.
In my scenario, I want to export html Table data (of web application) to Excel sheet.
( I can did this by getting Cell by Cell data from the table but it is time consuming so ........
I need another method to export total data single time)
( I can did this by getting Cell by Cell data from the table but it is time consuming so ........
I need another method to export total data single time)
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2012
11:51 PM
06-19-2012
11:51 PM
Hi,
Excel has a built-in HTML table import feature, when you can paste the <table>...</table> HTML text into a worksheet, and Excel will automatically transform it into the corresponding table.
To automate this process, you could use a script like this:
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Excel has a built-in HTML table import feature, when you can paste the <table>...</table> HTML text into a worksheet, and Excel will automatically transform it into the corresponding table.
To automate this process, you could use a script like this:
Sub ExcelTableImport
Dim strTableFruits, oExcel
' Copy the HTML source code of the table to the clipboard
Browsers.Item(btIexplorer).Run "http://www.w3schools.com/html/html_tables.asp"
strTableFruits = Sys.Browser.Page("http://www.w3schools.com/html/html_tables.asp").Panel(0).Panel(0).Panel(2).Panel(0).Panel(1).Table(0).outerHTML
Sys.Clipboard = strTableFruits
' Create an Excel workbook, paste the HTML table into it and save the file
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oExcel.Workbooks.Add
oExcel.ActiveSheet.Paste
oExcel.ActiveWorkbook.SaveAs "E:\HTMLTable.xlsx"
oExcel.Quit
End Sub
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
