News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Extract tables from web pages

Started by jj2007, May 31, 2022, 08:51:03 PM

Previous topic - Next topic

jj2007

A little tool to extract tables from web pages and view them in Excel (or whatever application handles *.tab files on your machine):

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
  Let edi="https://en.wikipedia.org/wiki/List_of_countries_by_income_equality"  ; for example
  .While 1
        Let edi=Input$("URL: ", edi)
        .Break .if Len(edi)==0
        Let esi=FileRead$(edi)  ; get html from the URL
        FileWrite "~tmp.tab", NoTag$(esi)       ; write to disk without HTML tags
       ShEx "~tmp.tab"         ; launch the application associated with *.tab (often Excel)
  .Endw
EndOfCode


About a second after you hit Return, M$ Excel should show you something like this (if not, let me know):