|
老师
我想提取如下网址的内容
http://page.tdx.com.cn:7615/site ... olor=##tdxbkcolor##
求助.rar
(36.53 KB, 下载次数: 0)
在本论坛的某个贴子里,偶然发现这两个自定义函数里,竟然包含了这个网址。
就是不知道怎么把它搞出输出来
- Private Function GetstrSource1(sCode As String) As String '第一个自定义函数【GetstrSource1】
- Dim url As String
- url = "http://page.tdx.com.cn:7615/TQLEX?Entry=CWServ.cfg_fx_yzlhb"
- Dim strSend As String
- strSend = "{""Params"":["
- strSend = strSend & """yybxq"","
- strSend = strSend & """""," & """"","
- strSend = strSend & """" & sCode & ""","
- strSend = strSend & """""," & "0,20]}"
- '{"Params":["yybxq","","","001319","",0,20]}
- With CreateObject("MSXML2.XMLHTTP")
- .Open "POST", url, False
- .send CStr(strSend)
- GetstrSource1 = StrConv(.Responsetext, vbNarrow)
- End With
-
- Open ThisWorkbook.Path & "" & sCode & ".txt" For Output As #1
- Print #1, GetstrSource1: Close #1 '关闭文件
-
- End Function
- Private Function NewStock(strStock As String) As String '第二个自定义函数【NewStock】
- Select Case left(strStock, 2)
- Case "60", "68", "11"
- NewStock = "sh" & Replace(strStock, Chr(34), "")
- Case "00", "30", "12"
- NewStock = "sz" & Replace(strStock, Chr(34), "")
- Case Else
- NewStock = "bj" & Replace(strStock, Chr(34), "")
- End Select
- End Function
复制代码
|
|