Skip to content

Instantly share code, notes, and snippets.

@martian17
Created October 27, 2022 02:15
Show Gist options
  • Save martian17/b4ea57e82b5216742588edb0c88e2e7c to your computer and use it in GitHub Desktop.
Save martian17/b4ea57e82b5216742588edb0c88e2e7c to your computer and use it in GitHub Desktop.
国土交通省ダウンロードフィルタリング
let inputs = [...document.querySelectorAll("table.responsive-table td input.waves-button-input")];
let arr = `01000-15.0b.zip
01000-20.0a.zip
02000-15.0b.zip
02000-20.0a.zip
03000-15.0b.zip
03000-20.0a.zip
04000-15.0b.zip
04000-20.0a.zip
05000-15.0b.zip
05000-20.0a.zip
06000-15.0b.zip
06000-20.0a.zip
07000-15.0b.zip
07000-20.0a.zip
08000-15.0b.zip
08000-20.0a.zip
09000-15.0b.zip
09000-20.0a.zip
10000-15.0b.zip
10000-20.0a.zip
11000-15.0b.zip
11000-20.0a.zip
12000-15.0b.zip
12000-20.0a.zip
13000-15.0b.zip
13000-20.0a.zip
14000-15.0b.zip
14000-20.0a.zip
15000-15.0b.zip
15000-20.0a.zip
16000-15.0b.zip
16000-20.0a.zip
17000-15.0b.zip
17000-20.0a.zip
18000-15.0b.zip
18000-20.0a.zip
19000-15.0b.zip
19000-20.0a.zip
20000-15.0b.zip
20000-20.0a.zip
21000-15.0b.zip
21000-20.0a.zip
22000-15.0b.zip
22000-20.0a.zip
23000-15.0b.zip
23000-20.0a.zip
24000-15.0b.zip
24000-20.0a.zip
25000-15.0b.zip
25000-20.0a.zip
26000-15.0b.zip
26000-20.0a.zip
27000-15.0b.zip
27000-20.0a.zip
28000-15.0b.zip
28000-20.0a.zip
29000-15.0b.zip
29000-20.0a.zip
30000-15.0b.zip
30000-20.0a.zip
31000-15.0b.zip
31000-20.0a.zip
32000-15.0b.zip
32000-20.0a.zip
33000-15.0b.zip
33000-20.0a.zip
34000-15.0b.zip
34000-20.0a.zip
35000-15.0b.zip
35000-20.0a.zip
36000-15.0b.zip
36000-20.0a.zip
37000-15.0b.zip
37000-20.0a.zip
38000-15.0b.zip
38000-20.0a.zip
39000-15.0b.zip
39000-20.0a.zip
40000-15.0b.zip
40000-20.0a.zip
41000-15.0b.zip
41000-20.0a.zip
42000-15.0b.zip
42000-20.0a.zip
43000-15.0b.zip
43000-20.0a.zip
44000-15.0b.zip
44000-20.0a.zip
45000-15.0b.zip
45000-20.0a.zip
46000-15.0b.zip
46000-20.0a.zip
47000-15.0b.zip
47000-20.0a.zip`.split("\n");
let o = {};
for(let v of arr){
o[v] = true;
}
(async()=>{
for(let i = 1; i <= 47; i++){
let a = ((100+i)+"").slice(-2)+"000-20.0a.zip";
let b = ((100+i)+"").slice(-2)+"000-15.0b.zip";
if(!(a in o)){
console.log(a,(i-1)*2+1);
inputs[(i-1)*2+1].click();
await new Promise(res=>setTimeout(res,1000));
}
if(!(b in o)){
console.log(b,(i-1)*2);
inputs[(i-1)*2].click();
await new Promise(res=>setTimeout(res,1000));
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment