Last active
November 14, 2017 08:45
-
-
Save muka/0447e02b6bb36adf1a76d15de9a154f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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