Skip to content

Instantly share code, notes, and snippets.

@anton-liubushkin
Last active October 23, 2018 18:07
Show Gist options
  • Save anton-liubushkin/cf295472d92dfe199ce914a3d25ca780 to your computer and use it in GitHub Desktop.
Save anton-liubushkin/cf295472d92dfe199ce914a3d25ca780 to your computer and use it in GitHub Desktop.
// JSON
var result = [...document.querySelectorAll('.n-snippet-cell2')].map(el => {
let item = {}
item.title = el.querySelector('.n-snippet-cell2__title').innerText; // Получить текст элемента
item.img = el.querySelector('img.image').src; // Получить адрес у картинки
// item.bg = el.querySelector('...').style.backgroundImage.replace(/url\(['"]?(.+?)['"]?\)/, '$1'); // Получить адрес фонового изображения
return item;
})
console.log(
JSON.stringify(result, null, 4)
)
// String
var str = '';
var result = [...document.querySelectorAll('tr.v-table-row-')].map(el => {
str = str + el.querySelector('.v-table-cell-content.v-table-cell-content-issueText').innerText + '\n';
})
console.log(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment