fix component. Add flags.
This commit is contained in:
18
scripts/captureTheFlag.ts
Normal file
18
scripts/captureTheFlag.ts
Normal file
@ -0,0 +1,18 @@
|
||||
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()
|
||||
})();
|
Reference in New Issue
Block a user