AKB総選挙も終わりました。そして気になるのが得票数。
http://sousenkyo.akb48.co.jp/result.php
せっかくなので分析可能な状態にしましょう。
javascriptソース
console.log(Array.from(
document.querySelectorAll(".member-list > li"),
e => {return e.querySelector(".result_name").innerText + "," + e.querySelector(".result_count").innerText.replace(/[^0-9]/g, ''); }
).join("\n"));
これを、
http://sousenkyo.akb48.co.jp/result.php
を開いている、Chromeのコンソールに貼り付けてエンターを押すと、CSVでダンプされます。
こんな感じ。
指原 莉乃,243011
渡辺 麻友,175613
松井 珠理奈,112341
山本 彩,110411
柏木 由紀,92110
宮脇 咲良,78279
須田 亜香里,69159
島崎 遥香,68126
兒玉 遥,60591
武藤 十夢,58624
横山 由依,58610
北原 里英,50190
向井地 美音,47094
岡田 奈々,43318
...
あとは、これをエクセルに貼り付けて、グラフにすれば、選挙の規模感が分かる。
グラフ
http://qiita.com/yugo-yamamoto/items/b87470f118ac62dc6a8d
で、書いてる、最期の方法をひな形に、querySelectoAllとArray.Fromを使って、繰り返し処理にしています。