Answer the question
In order to leave comments, you need to log in
How to track page changes?
Good afternoon!
I'm trying to remove links leading to Yandex turbo pages in Yandex search results
$('a[data-sc-host]').each(function() {
var urlYaTurbo = $(this).attr('href');
var dataCounter = JSON.parse($(this).attr('data-counter'));
if ((urlYaTurbo.indexOf('https://yandex.ru/turbo/s/') != -1) || (urlYaTurbo.indexOf('https://yandex.ru/turbo?text=') != -1)) {
$(this).attr('data-bem', '{"link":{}}');
if (dataCounter[0] == 'b') {
$(this).attr('href', dataCounter[1]);
} else if (dataCounter[0] == 'w') {
$(this).attr('href', dataCounter[3]);
}
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question