Created
September 29, 2024 18:33
-
-
Save WittmannF/61bad7f191b6d77ea3f8d09d2896a5a7 to your computer and use it in GitHub Desktop.
Google Scholar Auto Save Script - Script designed to automate the process of saving articles from Google Scholar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to automate saving process with dynamic reading list selection | |
function saveArticles(readingListId) { | |
// Find all the "Save" buttons | |
const saveButtons = document.querySelectorAll('a.gs_or_sav'); | |
saveButtons.forEach((saveButton, index) => { | |
setTimeout(() => { | |
// Click the "Save" button | |
saveButton.click(); | |
// Wait for the dialog to appear | |
setTimeout(() => { | |
// Select the desired reading list checkbox based on the provided ID | |
const desiredCheckbox = document.querySelector(`a.gs_cb_gen[data-id="${readingListId}"]`); | |
if (desiredCheckbox) { | |
desiredCheckbox.click(); | |
} | |
// Click the "Done" button | |
const doneButton = document.querySelector('button#gs_lbd_apl'); | |
if (doneButton) { | |
doneButton.click(); | |
} | |
}, 1000); // Adjust delay time if needed | |
}, index * 2000); // Adjust delay between iterations if necessary | |
}); | |
} | |
// Call the function with the desired reading list ID | |
// Example: Call with "1024" for "ML Test" | |
saveArticles('1024'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to Use
Open Google Scholar and search for articles.
Open Developer Tools in Chrome (
F12
orCtrl+Shift+I
).Paste the script from the
main.js
file into the console.Call the function
saveArticles('list-id')
wherelist-id
is the ID of the reading list you'd like to use.Example: