Created
May 1, 2024 10:16
-
-
Save checco/194ff59274bad1e72451ab2f367c383e to your computer and use it in GitHub Desktop.
Bulk delete workouts on Garmin connect, via development tool console
This file contains hidden or 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 deleteWorkouts() { | |
const deleteWorkoutElements = document.querySelectorAll('.delete-workout'); | |
if (deleteWorkoutElements.length === 0) { | |
console.log('No more "delete-workout" elements found.'); | |
return; | |
} | |
deleteWorkoutElements[0].click(); | |
setTimeout(() => { | |
const deleteButton = document.querySelector('a.btn.btn-primary.js-saveBtn.btn-danger'); | |
if (deleteButton) { | |
deleteButton.click(); | |
} else { | |
console.log('Delete button not found.'); | |
} | |
setTimeout(() => { | |
deleteWorkouts(); | |
}, 1000); | |
}, 1000); | |
} | |
deleteWorkouts(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment