本人用msxml做网页数据采集,在ASP中都没问题,但到了VB中却报错,好像没有.send()方法.
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()大家怎么做的,可否给点代码参考一下???
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()大家怎么做的,可否给点代码参考一下???
可否详细指点一下... 谢谢先!
Private Sub Command3_Click() Dim httpRequest As MSXML.XMLHTTPRequest Set httpRequest = New MSXML.XMLHTTPRequest Dim StrXml As String '构造出要上传的XML串,这里节点使用中文 StrXml = "<Request>" & _ "<项目编号>" & Txtbh.Text & "</项目编号>" & _ "<项目名称>" & Txtname.Text & "</项目名称>" & _ "<价格>" & Txtprice.Text & "</价格>" & _ "<种类>" & TxtCategory.Text & "</种类>" & _ "<发生日期>" & Txtpdate.Text & "</发生日期>" & _ "</Request>" httpRequest.Open "POST", "http://localhost/webxml/putsingleinfo.asp", False httpRequest.send StrXml '如果错误 If httpRequest.Status <> 200 Then MsgBox httpRequest.statusText, , httpRequest.Status Exit Sub End If '以下是判断数据是否正确提交 Dim strretval As String Dim ResponseXml As DOMDocument Set ResponseXml = New DOMDocument Set ResponseXml = httpRequest.ResponseXml strretval = ResponseXml.selectSingleNode("//retval").Text MsgBox strretvalEnd Sub
可否详细指点一下... 谢谢先!
可以对象化了,每一个在"<>"里面的都是一个对象要链接就取链接,要图片就图片了