Sub GetStockByXq(ByVal sheet As Worksheet, beginCol As String)
Dim url As String
Dim codes As String, sTemp As String
Dim objHttp As Object
Dim objHTML, objWin As Object
Dim symbol As String, name As String, percent As Variant, open_price As Double
Set objHTML = CreateObject("HTMLFile")
Set objWin = objHTML.parentWindow
Set objHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
With objHttp
.Open "POST", "https://xueqiu.com/", False
.Option(WinHttpRequestOption_EnableRedirects) = True
.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0"
.setRequestHeader "pragma", "no-cache"
.setRequestHeader "cache-control", "no-cache"
.setRequestHeader "Referer", "https://xueqiu.com/"
.send "foo=bar&bar=bazinga"
sTemp = .responseText
End With
sTemp = .responseText运行有错误,应该如何修改呢
Dim url As String
Dim codes As String, sTemp As String
Dim objHttp As Object
Dim objHTML, objWin As Object
Dim symbol As String, name As String, percent As Variant, open_price As Double
Set objHTML = CreateObject("HTMLFile")
Set objWin = objHTML.parentWindow
Set objHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
With objHttp
.Open "POST", "https://xueqiu.com/", False
.Option(WinHttpRequestOption_EnableRedirects) = True
.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0"
.setRequestHeader "pragma", "no-cache"
.setRequestHeader "cache-control", "no-cache"
.setRequestHeader "Referer", "https://xueqiu.com/"
.send "foo=bar&bar=bazinga"
sTemp = .responseText
End With
sTemp = .responseText运行有错误,应该如何修改呢