Parsing 如何在VBScript中使用HTML标记解析网页

Parsing 如何在VBScript中使用HTML标记解析网页,parsing,vbscript,Parsing,Vbscript,我尝试使用VBScript提取比特币的价格。 我有以下HTML代码: 您的查询将获得一组HTML节点。您应该尝试更具体的方法,并获取其属性: MsgBox objIE.document.QuerySelectorAll("a[href='/currencies/bitcoin/#markets']").Item(0).getAttribute("data-usd") 您的查询将获得一组HTML节点。您应该尝试更具体的方法,并获取其属性: MsgBox objIE.document.Query

我尝试使用VBScript提取比特币的价格。 我有以下HTML代码:


您的查询将获得一组HTML节点。您应该尝试更具体的方法,并获取其属性:

MsgBox objIE.document.QuerySelectorAll("a[href='/currencies/bitcoin/#markets']").Item(0).getAttribute("data-usd")

您的查询将获得一组HTML节点。您应该尝试更具体的方法,并获取其属性:

MsgBox objIE.document.QuerySelectorAll("a[href='/currencies/bitcoin/#markets']").Item(0).getAttribute("data-usd")

因为表的行设置了id属性。您可以通过以下方式获取单元格的文本内容:

objIE.document.GetElementById("id-bitcoin").Cells(3).InnerText

因为表的行设置了id属性。您可以通过以下方式获取单元格的文本内容:

objIE.document.GetElementById("id-bitcoin").Cells(3).InnerText

谢谢iBug,我不知道在VBScript中可以使用CSSSelector。这是非常有用的!如果我想提取“$4399.61”,我该怎么做?因为有点different@BOB您可以使用
.innerText
来实现这一点。感谢iBug,我不知道在VBScript中您可以使用CSSSelector。这是非常有用的!如果我想提取“$4399.61”,我该怎么做?因为有点different@BOB你可以使用
.innerText
来做这个。我看到了
我看到了