'Haw JS parsing HTML by to First index in div.item_
In HTML structure i have "div.item_32536" and 4 "a" ( NO class - no ID).
<div class="item_3245672">
<a href="*****"><p>****</p></a> //<= only this
<a href="*****"><p>****</p></a>
<a href="*****"><p>****</p></a>
</div>
What i can Parsing this structure, and have result, only to Index "First to TOP" in "div.item_".
//My cod
for (var link of document.querySelectorAll (`[class*="item_"] a`)) {
i.push({'title': link.text, 'href': link.getAttribute('href')});
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
