Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var items = [];
- items.push("");
- $('#schedule_table tr th').each(function(i,item){
- if (i % 2 == 1 && i != 5) {
- items.push(strip(item).trim());
- }
- });
- $('#schedule_table tr td').each(function(i,item){
- var j = (i-1) % 12;
- if (j==1 || j==3) {
- items.push(strip(item).trim().substr(0,5));
- } else if (j==7 || j==9 || j==11) {
- items.push(strip(item).trim());
- } else if (j==0) {
- items.push("\n");
- }
- });
- function strip(item) {
- if ($(item).find('div a').length > 0) {
- return $(item).find('div a').first().text();
- } else if ($(item).children('a').length > 0) {
- return $(item).children('a').text();
- } else if ($(item).children('div').length > 0) {
- return $(item).children('div').first().text();
- } else {
- return $(item).text();
- }
- }
- console.log(items.join("\t"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement