Answer the question
In order to leave comments, you need to log in
How to click a button on someone else's site through the console?
There is a site where you need to press all buttons with aria-label="Add to favorite tracks"
I tried different scripts through the console, those that access the button class - cause, among other things, pressing buttons with a class: class="action-item- btn datagrid-action", etc.
The $('button.datagrid-action').click(); function worked best.
But all buttons that contain "datagrid-action" are pressed this way:
button class="datagrid-action" type="button" aria-label="Show menu">
button
class="datagrid-action" type= "button" aria-label="Remove from Favorite Tracks">
button
class="action-item-btn datagrid-action" type="button"
Is there a way to set additional options? Or how else can this problem be solved?
Button Properties:
class="datagrid-action"
type="button"
aria-label="Add to Favorite Tracks"
Answer the question
In order to leave comments, you need to log in
const buttons = document.querySelectorAll('button.datagrid-action[type="button"][aria-label="Добавить в любимые треки"]');
Array.from(buttons).forEach(b => {
b.click();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question