0
I created a script to scroll through the table and return me a console.log of the content in it, but in the first few lines it doesn’t take the name of the Course, only the prices.
I saw that in the TD of the table where it says RIGHT, has a rowspan=2 in css. But I don’t know what condition I should use to read my script correctly.
Link to the table I want to browse with jQuery:
http://www.ciesa.br/details-menu/107-indicadores-de-qualidade-2.html
My code is as follows:
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);
Getting the name of the course is even easy, the problem is knowing what price is of what. For example, how will you know that Law is 1,100 in the morning and evening and 1,200 in the evening if they are in different rows and in different columns?
– Sam
So, what’s going on is this. I just don’t know how to create a specific if for this line in the beginning that is out
– Juan Lencina
Well eh. You have to do an if cabuloso to find the respective values. I’ll see if I can here.
– Sam
I’m trying too, but still unsuccessful.
– Juan Lencina