Last active
January 28, 2022 18:31
-
-
Save lionel-rowe/4314cde083aad1103c47c11d4223590c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// https://web.archive.org/web/20160920191749/http://zhaoren.idtag.cn/samename/searchName!pmbyrepeatlist.htm | |
const 姓名 = [...document.querySelectorAll('li p')] | |
.map(x => x.textContent.trim().match(/^\d+\.(.+)$/)) | |
.filter(Boolean) | |
.map(x => x[1]) | |
const 姓 = [...new Set(姓名.map(x => x[0]))].join('') | |
const 名 = [...new Set(姓名.flatMap(x => [...x.slice(1)]))].join('') | |
console.log({ 姓, 名 }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment