2017-08-16 53 views
0

有這樣的html:VBA HTML標記文本查詢

<h1 class="title">NOW ZINC PICOLINATE 50MG 60caps CYNK PIKOLINIAN 
    <small>(6826446676)</small> 
</h1> 

我想只有這個:「NOW吡啶羧酸鋅50MG 60caps CYNK PIKOLINIAN」

當我使用:

HTMLDoc.getElementsByTagName("h1")(0).innerText 

我得到:「NOW吡啶羧酸鋅50MG 60caps CYNK PIKOLINIAN(6826446676)」

回答

1
HTMLDoc.getElementsByTagName("h1")(0).childNodes(0).nodeValue 
'           /|\ 
'  All nodes, including #text -------| 
+0

nope。它給了我一個自動化錯誤 – emilll

+0

Ups,更正! –