Skip to content

Instantly share code, notes, and snippets.

@oonyanya
Last active December 2, 2025 05:43
Show Gist options
  • Select an option

  • Save oonyanya/40fd5b26a100d338aec3d732c52136db to your computer and use it in GitHub Desktop.

Select an option

Save oonyanya/40fd5b26a100d338aec3d732c52136db to your computer and use it in GitHub Desktop.
川口市の投票所から投票所名、住所、経度、緯度を取り出すやつ
const links = document.querySelectorAll('#contents-in table tr').forEach((tr)=>{
let datas = tr.querySelectorAll('td p');
if(datas.length == 0)
return;
let address = datas[2].textContent;
let as = tr.querySelectorAll('td p a');
let a = as[0];
let url = a.getAttribute('href');
let text = a.textContent.trim();
str = new URL(url).searchParams.get("ll").split(",");
console.log(text + ","+ address +"," + str[1] + "," + str[0]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment