Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
Join the name of the columns in comma-sperated format whilst parsing the table with Cheerio

I am trying to parse the columns and rows of the timetable and then have it in a CSV file to import it to my google calendar.

So I when I try to get the title of the columns for perhaps any data from the column it comes one under another (refer the pic below.) [out of the code on terminal1

the code for the above output can be found below.

const columnTitles = $('.spreadsheet .spreadsheet .columnTitles')
.each((i, element)=> {
  const nameLabel = $(element).text().trimStart().trimEnd();
  console.log(nameLabel );
})

Below is the screenshot of HTML Elements enter image description here

What am I missing on here? and how can I have it as comma-separated-values?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If it's just one table, then it's simple:

var html_table = $('.spreadsheet .spreadsheet .columnTitles');
var table_header = html_table.find('td').map(function() {return $(this).text().trim();}).toArray();
console.log('table_header', table_header.join(', '));
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda