Author Topic: Once upon a time, Internet Explorer could export a table to Excel  (Read 51 times)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 10861
  • Assembler is fun ;-)
    • MasmBasic
Once upon a time, Internet Explorer could export a table to Excel, and that was quite a handy function. However, after a security update in 2016, MSIE stopped doing so.

That bothered me a lot, because I frequently extract data from websites, so I decided to enhance NoTag$() a little bit:

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init                                          ; extract only the table from the HTML file
  Let esi=NoTag$(FileRead$("https://www.tuttitalia.it/regioni/popolazione"), table)
  FileWrite "test.tab", esi
  ShEx "test.tab"               ; launch your default tab viewer
EndOfCode


Works like a charm, but not with all sites. Sometimes you need to save a page as e.g. test.html, then drag the file over the attached exe and the sample html file taken from the Forum stats. Occasionally, minor corrections are needed. Let me know if you know a page that fails miserably - it's work in progress :cool:

P.S.: There is a second issue that drove me nuts. Some pages use the 2.000,12 syntax instead of 2,000.12, and that is quite a nuisance with imports to Excel. If you have such a site, add a third argument swcd (swap commas and dots)