New answers tagged

1

The problem is that the Wikipedia tables have <th> tags on the first row whereas this webpage uses <td> tags for the header line. For this reason, in the xmlTableToDataset function you need to replace headers = Cases[ headerRow, d : XMLElement["th", _, _] :> (... etc ...), Infinity ]; with headers = ...


1

If you only want to scrap tables, here is another alternative: ClearAll[scrapTables, scrapTablesCore]; scrapTables[url_String] := scrapTablesCore[URLRead[url]["Body"]] scrapTables[path_File] := scrapTablesCore[ReadString[path]] scrapTablesCore[text_String] := DeleteCases[#, {}, Infinity] &@ StringCases[text, Shortest[ ...


Top 50 recent answers are included