我是xmlhttp的新手。我结合并整理了在互联网上找到的代码。但是,我仍然无法正确获取它。
我尝试访问的URL。我想获取数据(打开,关闭,高,低)到excel中。它在图表的右侧。 https://tw.screener.finance.yahoo.net/future/aa05?sid=WTX%26&sname=%E5%8F%B0%E6%8C%87%E6%9C%9F%E8%BF%91%E4%B8%80&mid=01&type=1
我猜问题出在“ HTMLsourcecode.body.innerHTML = .responseText”上,但是我不知道什么是正确的代码。 ''''''''''''''''''''''''''''''''' 请帮忙。
Dim URL, HTMLsourcecode, GetXml
Set HTMLsourcecode = CreateObject("htmlfile")
Set GetXml = CreateObject("msxml2.xmlhttp")
URL = "https://tw.screener.finance.yahoo.net/future/aa05?sid=WTX%26&sname=%E8%87%BA%E6%8C%87%E6%9C%9F%E8%BF%91%E4%B8%80&mid=01&type=1" ''
With GetXml
.Open "GET", URL, False
.setRequestHeader "Cache-Control", "no-cache"
.setRequestHeader "Pragma", "no-cache"
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send
HTMLsourcecode.body.innerHTML = .responseText
Set Table = HTMLsourcecode.all.tags("table")(0).Rows
For j = 2 To Table(i).Cells.Length - 1
Next j
End With
Set HTMLsourcecode = Nothing
Set GetXml = Nothing
先谢谢了。