I created a script to go through the table and return a console.log of the content in it, but in the first few lines does not take the name of the Course, just the prices.
I saw that in the table TD where it says RIGHT, it has a rowspan = 2 in the css. But I do not know what condition I should use for my script to read correctly.
Link of table that I want to go through with jQuery:
My code looks like this:
var c = [];
jQuery('table tbody tr:gt(4)').each(function(ii, tr){
if($(tr).find('td:eq(1)').text().indexOf("R$")>-1){
var price = {
course_name: $(tr).find('td:eq(0)').text(),
price: $(tr).find('td:eq(1)').text(),
turn: 'Matutino'
};
c.push(price);
var price = {
course_name: $(tr).find('td:eq(0)').text(),
price: $(tr).find('td:eq(1)').text(),
turn: 'Vespertino'
};
c.push(price);
var price = {
course_name: $(tr).find('td:eq(0)').text(),
price: $(tr).find('td:eq(1)').text(),
turn: 'Noturno'
};
c.push(price);
}
}); console.log(c);