https://48pedia.org/%E6%AC%85%E5%9D%8246%E3%83%A1%E3%83%B3%E3%83%90%E3%83%BC%E4%B8%80%E8%A6%A7 を開いて Chrome の Developer Tools の Console から実行する。
Last active
January 1, 2018 16:52
-
-
Save yuya-takeyama/267571869535ce563ddb241c7ee358c3 to your computer and use it in GitHub Desktop.
エケペディアの欅坂46メンバー一覧ページから誕生日データを抽出する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.stringify(Array.from(document.querySelectorAll('.sortable.wikitable.jquery-tablesorter')[0].querySelectorAll('tbody tr')).map(e => { return { name: e.querySelectorAll('td')[2].querySelector('a').innerText, kana: e.querySelectorAll('td')[2].querySelector('rt').innerText, birthday: e.querySelectorAll('td')[3].innerText.match(/(\d{4})年(\d+)月(\d+)日/) } }).map(d => { return { name: d.name, lastNameKana: d.kana.split(' ')[0], firstNameKana: d.kana.split(' ')[1], birthday: [parseInt(d.birthday[1], 10), parseInt(d.birthday[2], 10), parseInt(d.birthday[3], 10)] }; }).map(d => { return { ...d, birthday: '' + d.birthday[0] + '-' + (d.birthday[1] < 10 ? '0' : '') + d.birthday[1] + '-' + (d.birthday[2] < 10 ? '0' : '') + d.birthday[2] }; })) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment