I need to download a spreadsheet made with spreadsheets like csv and be able to use the information with javascript. I have this code:
function fetchCSV () {
let src = "https://docs.google.com/spreadsheets/d/e/GZ5l45JT9VV-y/pub?gid=1670264290&single=true&output=csv"
fetch(src, {
headers: new Headers({
'Content-Type': 'text/csv'
}),
mode: 'no-cors'
})
.then(response => response.text())
.then(data => {
console.log(data)
})
}
document.addEventListener('load',fetchCSV())
I can not access the CSV information or using reponse.text () or response.blob (), but in developer tools if I can see the contents of the csv.
How can I access the contents of the csv file?