Skip to content

Instantly share code, notes, and snippets.

@ProjectEli
Created August 11, 2024 02:18
Show Gist options
  • Save ProjectEli/6d174a11036bbfc5a871fa90c521285f to your computer and use it in GitHub Desktop.
Save ProjectEli/6d174a11036bbfc5a871fa90c521285f to your computer and use it in GitHub Desktop.
Google scholar extract as json
const tableBody = document.getElementById('gsc_a_b');
const rows= tableBody.querySelectorAll('tr');
const rowdata = [];
rows.forEach(row => {
const cells = row.querySelectorAll('td');
const title = cells[0].querySelector('a').textContent;
const authors = cells[0].querySelector('.gs_gray').textContent.trim();
const journal = cells[0].querySelectorAll('.gs_gray')[1].textContent.trim();
const citations = cells[1].querySelector('a').textContent;
const year = cells[2].textContent;
rowdata.push({ title, authors, journal, citations, year });
});
console.log(rowdata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment