Skip to content

Instantly share code, notes, and snippets.

@cwardzala
Last active February 2, 2017 21:13
Show Gist options
  • Save cwardzala/df03df5c8f20e5560a82af45ace0db92 to your computer and use it in GitHub Desktop.
Save cwardzala/df03df5c8f20e5560a82af45ace0db92 to your computer and use it in GitHub Desktop.
data = {};
$('section.tab-content').each((i, el) => {
let section_data = [];
let title = $(el).find('h2');
let h3s = $(el).find('h3');
let rows = $(el).find('.row-default');
console.log(title.text());
h3s.each((i, h3el) => {
section_data.push({
header: $(h3el).text(),
sections: []
});
});
rows.each((ri, rel) => {
$(rel).find('.lg-3, .lg-4').each((si, sel) => {
let s_data = {
header: $(sel).find('h5').text(),
links: []
};
$(sel).find('a').each((ai, a) => {
s_data.links.push({
text: $(a).text(),
url: a.pathname
})
});
console.log(section_data[ri]);
section_data[ri].sections.push(s_data);
});
});
data[title.text()] = section_data;
});
Object.keys(data).forEach(key => {
console.log(key);
console.log(JSON.stringify(data[key]));
});
@JessicaLawson
Copy link

Hello
Happy to meet you, my name is Miss Jessica Lawson, it is my pressure to meet you here  today through this site, i will like you to write to me so that i can be able to tell you more about me and the reason of my contact with you. here is my private email address, please write to me here so that i can tell you more anout me and also to send my picture  to you ( jesicalawson91@gmail.com )  thanks

Yours Miss Jessica Lawson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment