- Ingresar en http://especiales.lanacion.com.ar/multimedia/proyectos/16/07/jjoo_2016_medallero/index.html
- Abrir la consola (f12)
- Copiar y pegar el código que está en script.js y dar enter.
Created
August 22, 2016 19:20
-
-
Save cbertelegni/5880717f4ff4b3126e2eed49bc90ce6f to your computer and use it in GitHub Desktop.
Descargar los datos del medallero como CSV desde LN: http://especiales.lanacion.com.ar/multimedia/proyectos/16/07/jjoo_2016_medallero/index.html
This file contains hidden or 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 w = $("#cuantries_wraper"); | |
| var data = []; | |
| $(".row", w).each(function(d, e){ | |
| var dd = []; | |
| var r = $(e) | |
| r.find("span.position").remove() | |
| dd.push(r.find("h3").html()); | |
| dd.push(r.find(".medal_count_gold span").html()); | |
| dd.push(r.find(".medal_count_silver span").html()); | |
| dd.push(r.find(".medal_count_bronze span").html()); | |
| data.push(dd); | |
| }); | |
| var csv = data.map(function(d){ | |
| return d.join(","); | |
| }).join("\n"); | |
| // console.log(csv); | |
| var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(csv); | |
| var downloadLink = document.createElement("a"); | |
| downloadLink.href = uri; | |
| downloadLink.download = document.title ? document.title.replace(/ /g, "_") + ".csv" : "data.csv"; | |
| document.body.appendChild(downloadLink); | |
| downloadLink.click(); | |
| document.body.removeChild(downloadLink); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment