发送POST并检索数据(参数问题)

时间:2018-05-03 20:48:39

标签: excel excel-vba vba

Sub macroPOST()
Dim objHTTP As Object
Dim objIE As Object
Dim response As String

Set objIE = CreateObject("InternetExplorer.Application")
objIE.navigate "about:blank"
objIE.Visible = True

Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = "https://www.google.com/"
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.send ("q=123456")

response = objHTTP.responseText

objIE.document.write response

Set objHTTP = Nothing
End Sub

我想填充Google搜索栏,然后点击按钮。

我不明白什么构成了post参数?它应该是我设置我的值等于的标签名称,标题,类,ID吗?我试图查看较旧的示例,寻找如何将参数加载放在一起的解释但是没有想到它

0 个答案:

没有答案