!7
p-tt {
S html = loadPage("https://en.wikipedia.org/wiki/Most_common_words_in_English");
L tok = htmlTok(html);
new TreeMap map;
for (L toktable : /*dropFirst*/(findContainerTagDeep(tok, "table"))) {
LL tokTH = map(f textOfContainerTag, html_findTHs(toktable));
printStruct("TH: ", tokTH);
if (eq(tokTH, ll("Rank", "Word"))) {
print("Yay!");
for (L tr : html_findTRs(toktable)) {
L bla = map(f textOfContainerTag, html_findTDs(tr));
printStruct("TDs: ", bla);
if (l(bla) == 2 && isInteger(first(bla)))
map.put(parseInt(first(bla)), second(bla));
}
}
}
printAsciiHeading("Here are the words!");
pnl(values(map));
}