Challenge 3

Get Article Links from a Google Scholar Profile

Organizing Web Data with JavaScript
JavaScript

Background

A researcher comes to you and asks your help putting together their dossier for tenure and promotion. To make the case that they are doing good work, they would like a list of links to their top-cited articles as a table to include in their dossier, which will be a Microsoft Word document. So, you need to get a list of their top articles (without any other data) from Google Scholar and make them into a table that works in Microsoft Word.

Task

Go to a scholar's profile on Google Scholar and extract their top 100 articles as a table of links (e.g., Royce Kimmons).

Looking in the Inspector, you find that each link for an article on Google Scholar has the class "gsc_a_at".

Go to ChatGPT or another AI and ask it the following:

in JS, find all links with the class gsc_a_at and return them as a table in the console

This provides the following command, which you can then run in the Inspector Console:

const links = document.querySelectorAll(".gsc_a_at");
const linkData = [];
links.forEach((link) => {
  const href = link.href;
  const text = link.textContent;
  linkData.push({ href, text });
});
console.table(linkData);

This provides the following table in the Inspector Console:

This table can then be copy/pasted to Microsoft Word.

This content is provided to you freely by EdTech Books.

Access it online or download it at https://edtechbooks.org/elearning_hacker/google_scholar.