用VBA抓取网页数据 我想用VBA抓取http://www.cninfo.com.cn/information/companyinfo.html上面的数据,想抓取 投资者关系信息->调研活动 下面每一条新闻的标题内的日期以及新闻发布的日期 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://club.excelhome.net/thread-893760-1-1.html 版主大大,我按照那个教程试着做了一下,但是不能post提交上去不知道怎么做啊,初学不懂啊Sub test() Dim strRespText$, tt$, i&, DW$ Dim URL URL = "http://www.cninfo.com.cn/information/companyinfo.html" With CreateObject("Microsoft.XMLHTTP") .Open "GET", URL, False .send tt = .responseText With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With 'tt = BytesToBstr(.ResponseBody, "GB2312") 'tt = StrConv(.ResponseBody, vbUnicode,&H804) tt = StrConv(.ResponseBody, vbUnicode) With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With End With viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0) eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0) 'MsgBox (viewstate) Dim Leibie Leibie = "tzzgxxx" Dim code code = "000001" With CreateObject("WinHttp.WinHttpRequest.5.1") tt = "" .Open "POST", URL, False .setRequestHeader "Referer", URL .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=utf-8" .setRequestHeader "Connection", "Keep-Alive" .send "hlmname=" & Leibie & "&hstockcode=" & code tt = .responseText With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With End With viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0) eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0) MsgBox (viewstate)End Sub 能帮我看看这个code么?Sub test() Dim strRespText$, tt$, i&, DW$ Dim URL URL = "http://www.cninfo.com.cn/information/companyinfo.html" With CreateObject("Microsoft.XMLHTTP") .Open "GET", URL, False .send tt = .responseText With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With 'tt = BytesToBstr(.ResponseBody, "GB2312") 'tt = StrConv(.ResponseBody, vbUnicode,&H804) tt = StrConv(.ResponseBody, vbUnicode) With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With End With viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0) eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0) 'MsgBox (viewstate) Dim Leibie Leibie = "tzzgxxx" Dim code code = "000001" With CreateObject("WinHttp.WinHttpRequest.5.1") tt = "" .Open "POST", URL, False .setRequestHeader "Referer", URL .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=utf-8" .setRequestHeader "Connection", "Keep-Alive" .send "hlmname=" & Leibie & "&hstockcode=" & code tt = .responseText With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") .SetText tt .PutInClipboard End With End With viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0) eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0) MsgBox (viewstate) End Sub 动态控件问题 combobox list 项中输入数据有问题?急等 为什么在我的电脑上用户名突然登陆不上CSDN上,而在我的同事电脑上用户名就可以登CSDN上, 关于一个数据文件 请问怎样通过编程的方法调整声音的音量 一个非常简单的问题,和数据库的操作有关!(在线等待) crytal 报表问题,在线等待! 简单的webbrowser控件的问题! vb通过ODBC调用Sybase数据库时如何设置数据库驱动程序(重分奖励)? ACCESS数据库如何远程连接 请问vb如何设置excel的允许调整A4/Letter纸型属性? VBA sql根据行号查询,请教大师....急救120
Dim strRespText$, tt$, i&, DW$
Dim URL
URL = "http://www.cninfo.com.cn/information/companyinfo.html"
With CreateObject("Microsoft.XMLHTTP")
.Open "GET", URL, False
.send
tt = .responseText
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
'tt = BytesToBstr(.ResponseBody, "GB2312")
'tt = StrConv(.ResponseBody, vbUnicode,&H804)
tt = StrConv(.ResponseBody, vbUnicode)
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
End With
viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0)
eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0)
'MsgBox (viewstate)
Dim Leibie
Leibie = "tzzgxxx"
Dim code
code = "000001"
With CreateObject("WinHttp.WinHttpRequest.5.1")
tt = ""
.Open "POST", URL, False
.setRequestHeader "Referer", URL
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"
.setRequestHeader "Connection", "Keep-Alive"
.send "hlmname=" & Leibie & "&hstockcode=" & code
tt = .responseText
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
End With
viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0)
eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0)
MsgBox (viewstate)End Sub
Dim strRespText$, tt$, i&, DW$
Dim URL
URL = "http://www.cninfo.com.cn/information/companyinfo.html"
With CreateObject("Microsoft.XMLHTTP")
.Open "GET", URL, False
.send
tt = .responseText
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
'tt = BytesToBstr(.ResponseBody, "GB2312")
'tt = StrConv(.ResponseBody, vbUnicode,&H804)
tt = StrConv(.ResponseBody, vbUnicode)
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
End With
viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0)
eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0)
'MsgBox (viewstate)
Dim Leibie
Leibie = "tzzgxxx"
Dim code
code = "000001"
With CreateObject("WinHttp.WinHttpRequest.5.1")
tt = ""
.Open "POST", URL, False
.setRequestHeader "Referer", URL
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"
.setRequestHeader "Connection", "Keep-Alive"
.send "hlmname=" & Leibie & "&hstockcode=" & code
tt = .responseText
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText tt
.PutInClipboard
End With
End With
viewstate = Split(Split(tt, "hlmname"" value=""")(1), """")(0)
eventvalidation = Split(Split(tt, "hstockcode"" value=""")(1), """")(0)
MsgBox (viewstate)
End Sub