Skip to content

Instantly share code, notes, and snippets.

@shisama
Created January 12, 2020 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shisama/f427dbf552228e0f3bcad72b282e6c4a to your computer and use it in GitHub Desktop.
Save shisama/f427dbf552228e0f3bcad72b282e6c4a to your computer and use it in GitHub Desktop.
Weblioの単語帳画面から単語と意味をカンマ区切りの一覧で引っこ抜いてクリップボードにコピーするスクリプト
copy(Object.values(document.getElementsByClassName("tngMainTrOn")).map(el => {
const text = el.innerText
const textArr = text.split("\n")
const en = textArr[0]
const ja = textArr[2].split(",").join("、")
return `${en}, ${ja}`;
}).join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment