If I understand you correctly - you should use a special extension for Chrome: Tampermonkey . This extension allows you to run your scripts on the necessary pages / domains, etc.
As for the script itself:
If you use pure JS:
// Сохраняем в переменную узел с нашим баннером, узнав его по id var someDOMElement = document.getElementById('aw0'); // А так мы можем взять любой атрибут, например href var hrefOfelement = someDOMElement.getAttribute('href'); // Можно всё делать в одну строку var hrefOfelement = document.getElementById('aw0').getAttribute('href');
Elements can be obtained by other attributes.
As for your task, the algorithm is as follows: 1) Collect all the elements you need for DOM, for example, into an array (in JS these are objects); 2) In the cycle we go through each of them.