!7 p { set loadPage_debug; S baseURL = "http://legend.freebooks2017.org/Legend_1/"; int page = 1; while licensed { S html = loadPageWithUserAgent(pageURL(baseURL, page), "Mac Safari"); print("Loaded: " + l(html)); L paragraphs = map(f htmldecode_dropAllTags, contentsOfPTags(html)); //printNumberedLines(paragraphs); print("#PAGE + " + page + "#"); for (S p : paragraphs) { print("#P#"); print(p); } if (!html.contains(pageURL(baseURL, ++page))) break; } } sS pageURL(S baseURL, int page) { baseURL = addSlash(baseURL); if (page <= 0) fail("woot"); else if (page == 1) ret baseURL; else ret baseURL + "index_" + page + ".html"; }