Skip to content

Instantly share code, notes, and snippets.

@muka
Last active November 14, 2017 08:45
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 muka/0447e02b6bb36adf1a76d15de9a154f3 to your computer and use it in GitHub Desktop.
Save muka/0447e02b6bb36adf1a76d15de9a154f3 to your computer and use it in GitHub Desktop.
var items = []
var read = ()=> {
var clr = (s) => s.replace("\n", "").trim()
jQuery('.media-body').each((i, el) => {
var item = jQuery(el)
//console.log(item)
let row = [
clr(item.find('h4 a').text().trim()),
'https://www.cooperazionetrentina.it' + clr(item.find('h4 a').attr('href').trim()),
clr(item.find('.attribute-intro').eq(0).text().trim()),
clr(item.find('.attribute-intro').eq(1).text().trim()),
]
//console.log(row)
items.push(
row.join(";")
)
})
}
var c = 0
var tmr = setInterval(function(){
read();
jQuery('.pagination:eq(0) li:last a').trigger("click")
c++
if(c > 10) {
clearInterval(tmr)
console.log(items.join("\n"))
}
}, 3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment