如何从HTMLcollection获取锚定标记

如何从HTMLcollection获取锚定标记,html,reactjs,Html,Reactjs,我有一个像下面这样的物体 HTMLCollection [] 0: a accessKey: "" assignedSlot: null attributeStyleMap: StylePropertyMap {size: 0} attributes: NamedNodeMap {0: href, href: href, length: 1} autocapitalize: "" baseURI: "http://localhost:3000/r

我有一个像下面这样的物体

HTMLCollection []
0: a
accessKey: ""
assignedSlot: null
attributeStyleMap: StylePropertyMap {size: 0}
attributes: NamedNodeMap {0: href, href: href, length: 1}
autocapitalize: ""
baseURI: "http://localhost:3000/resources/sample-test-post-title"charset: ""
hash: ""
hidden: false
host: "test.muja.abc.xyz"
hostname: "test.muja.abc.xyz"
href: "https://test.muja.abc.xyz/resources/children-pesticides"
hreflang: ""
id: ""e
我试图通过这个代码从内容中获取标签

const divs = document.getElementsByClassName('detail-page-content');
for (var i = 0; i < divs.length; i++) {
  const a =  divs[i].getElementsByTagName('a'); // This will return above HTMLCollection
}
const divs=document.getElementsByClassName('detail-page-content');
对于(变量i=0;i
如何从中获取锚定标记、href数据?因为常量a是HTMLCollection和一个对象,所以我无法迭代它。 我尝试将对象转换为数组,但也失败了

请帮帮我