|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 onlycxb 于 2018-2-24 21:30 编辑
- Sub Ccj()
- Dim winhttp As Object, html As Object, trs, msg As String
- Dim i, j, s
- Set html = CreateObject("htmlfile")
- Set winhttp = CreateObject("winhttp.winhttprequest.5.1")
- With winhttp
- .Open "POST", "http://zsks.cdcedu.cn/InfoCx_Result.aspx", False
- .setrequestheader "Content-Type", "application/x-www-form-urlencoded"
- .send "id=153&number=xxx&xm=xxx"
- html.body.innerhtml = .responsetext
- msg = html.all.tags("table")(0).innertext + Chr(10)
- Set trs = html.all.tags("table")(1).Rows
- For i = 0 To trs.Length - 1
- s = ""
- For j = 0 To trs(i).Cells.Length - 1
- s = IIf(s = "", "", s + ",") + trs(i).Cells(j).innertext
- Next j
- msg = msg + s + Chr(10)
- Next i
- End With
- MsgBox msg
- End Sub
复制代码 |
|