/HTMLTables

Import HTML tables as APL arrays

Primary LanguageHTMLMIT LicenseMIT

HTMLTables

Import HTML tables as APL arrays

 HTMLTables.ImportFromURL  {
    : Simple character vector URL
  {}: Indices of tables to import (default all tables)
    : Return a nested vector of nested matrices. Each matrix contains data from HTML tables fetched from the URL
}

How to use

Load with ]Get

  1. Import with ]Get from this repository's URL

    			]Get https://github.com/aplutils/HTMLTables
    #.HTMLTables

    Alternatively, clone this repository or download as .zip and extract

          ]Get /path/to/HTMLTables
    #.HTMLTables

    For use in scripts or other applications, import with ⎕SE.Link.Import as part of a build process

          'HTMLTables'⎕NS
          ⎕SE.Link.Import HTMLTables '/path/to/HTMLTables'
          Imported: #.HTMLTables  /path/to/HTMLTables
  2. Import HttpCommand

    			]Get HttpCommand -target=HTMLTables
    #.HTMLTables.HttpCommand

Call HTMLTables.ImportFromURL with a URL:

      54 HTMLTables.ImportFromURL 'https://en.wikipedia.org/wiki/List_of_Wimbledon_gentlemen%27s_singles_champions'
┌──────┬───────┬───────────────┬───────┬───────────────┬─────────────────────────┐
│┌────┐│┌─┬───┐│┌─────────┐    │┌─┬───┐│┌──────────┐   │┌─────────────┐          │
││1968│││ │AUS│││Rod Laver│    ││ │AUS│││Tony Roche│   ││63, 64, 62│          │
│└────┘│└─┴───┘│└─────────┘    │└─┴───┘│└──────────┘   │└─────────────┘          │
├──────┼───────┼───────────────┼───────┼───────────────┼─────────────────────────┤
│┌────┐│┌─┬───┐│┌─────────┐    │┌─┬───┐│┌─────────────┐│┌──────────────────┐     │
││1969│││ │AUS│││Rod Laver│    ││ │AUS│││John Newcombe│││64, 57, 64, 64│     │
│└────┘│└─┴───┘│└─────────┘    │└─┴───┘│└─────────────┘│└──────────────────┘     │
├──────┼───────┼───────────────┼───────┼───────────────┼─────────────────────────┤
│┌────┐│┌─┬───┐│┌─────────────┐│┌─┬───┐│┌────────────┐ │┌───────────────────────┐│
││1970│││ │AUS│││John Newcombe│││ │AUS│││Ken Rosewall│ ││57, 63, 62, 36, 61││
│└────┘│└─┴───┘│└─────────────┘│└─┴───┘│└────────────┘ │└───────────────────────┘│
├──────┼───────┼───────────────┼───────┼───────────────┼─────────────────────────┤
│┌────┐│┌─┬───┐│┌─────────────┐│┌─┬───┐│┌──────────┐   │┌───────────────────────┐│
││1971│││ │AUS│││John Newcombe│││ │USA│││Stan Smith│   ││63, 57, 26, 64, 64││
│└────┘│└─┴───┘│└─────────────┘│└─┴───┘│└──────────┘   │└───────────────────────┘│
├──────┼───────┼───────────────┼───────┼───────────────┼─────────────────────────┤
│┌────┐│┌─┬───┐│┌──────────┐   │┌─┬───┐│┌────────────┐ │┌───────────────────────┐│
││1972│││ │USA│││Stan Smith│   ││ │ROM│││Ilie Năstase│ ││46, 63, 63, 46, 75││
│└────┘│└─┴───┘│└──────────┘   │└─┴───┘│└────────────┘ │└───────────────────────┘│
└──────┴───────┴───────────────┴───────┴───────────────┴─────────────────────────┘