18 lines
461 B
TypeScript
18 lines
461 B
TypeScript
import {load} from "cheerio"
|
|
|
|
const QUERY = "ISO3166-1";
|
|
const PAGE = `https://openclipart.org/tag/${QUERY}`;
|
|
|
|
async function capture() {
|
|
for (let i = 1; i <= 1; ++i) {
|
|
const url = i > 1 ? PAGE + `?p=${i}?q=${QUERY}` : PAGE;
|
|
const data = await fetch(url);
|
|
const $ = load(await data.text());
|
|
const links = $("document").find("a");
|
|
console.log("%d links", links.length)
|
|
}
|
|
}
|
|
|
|
(async () => {
|
|
await capture()
|
|
})(); |