有这样的html:
<h1 class="title">NOW ZINC PICOLINATE 50MG 60caps CYNK PIKOLINIAN
<small>(6826446676)</small>
</h1>我只想得到这个:“现在皮柯利酸锌50毫克60盖CYNK皮科利南”
当我使用:
HTMLDoc.getElementsByTagName("h1")(0).innerText我得到:“现在皮柯利酸锌50毫克60盖CYNK皮科利宁(6826446676)”
发布于 2017-08-16 16:20:37
HTMLDoc.getElementsByTagName("h1")(0).childNodes(0).nodeValue
' /|\
' All nodes, including #text -------|https://stackoverflow.com/questions/45718281
复制相似问题