我用谷歌搜索了 data-reactid ,似乎在大多数情况下它不适用于 VBA。
但我仍然认为有可能得到答案。我想在“经营活动的总现金流量”中获得数字
https://finance.yahoo.com/quote/BABA/cash-flow?p=BABA
Sub YFinance()
Dim XMLReq As New MSXML2.XMLHTTP60
Dim HTMLDoc As New MSHTML.HTMLDocument
Dim i As Integer
Dim strUrl As String
XMLReq.Open "GET", "https://finance.yahoo.com/quote/BABA/cash-flow?p=BABA", False
XMLReq.send
If XMLReq.Status <> 200 Then
MsgBox "Error!"
Exit Sub
End If
HTMLDoc.body.innerHTML = XMLReq.responseText
Set XMLReq = Nothing
MsgBox HTMLDoc.getElementsById("Bdbw(0px)! H(36px)")(0).innerText
End Sub