네이버 태그 가져오기
const titles = [];
document.querySelectorAll('#NM_THEME_CONTAINER [data-page="1"].group_theme .theme_item')
.forEach(el => {
if ( el.querySelector('.title') ) {
const title = el.querySelector('.title').innerText;
titles.push(title);
}
});
console.log(titles);
const titles = [
...document.querySelectorAll(
'#NM_THEME_CONTAINER [data-page="1"].group_theme .theme_item'
)
]
.map((el) => el.querySelector(".title"))
.filter((el) => el != null)
.map((el) => el.innerText);
console.log(titles);