Skip to content

Instantly share code, notes, and snippets.

@misebox
Last active October 2, 2023 09:28
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 misebox/b110dd38e75418fc2329a744f59dc4a5 to your computer and use it in GitHub Desktop.
Save misebox/b110dd38e75418fc2329a744f59dc4a5 to your computer and use it in GitHub Desktop.
/:(.*株式会社.*)/ というテキストを含む h3 要素を探して、: **********に置換する
// /:(.*株式会社.*)/ というテキストを含む h3 要素を探して、: **********に置換する
[...document.querySelectorAll("h3")].forEach(h3 => {h3.innerText?.includes("株式会社") && (h3.innerHTML = h3.innerText.replace(/:.+/, ": **********")) && console.log(h3.innerText)});
[...document.querySelectorAll("p")].forEach(p => {p.innerText?.includes("氏名:") && (p.innerHTML = p.innerText.replace(/氏名:.+/, "氏名:********"))});
[...document.querySelectorAll("a")].forEach(a => {a.href.includes("misebox") && a.remove()});
[...document.querySelectorAll("script")].forEach(s => { s.remove()});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment