如何找到这个页面的XML数据源地址?

powerc1 2017-05-26 09:07:28
获取源页面是:http://www.gxcaipiao.com.cn/notice/notice_12.html

以前这个页面是可以通过:http://www.gxcaipiao.com.cn/xml/notice_12.xml 这个页面从xml的方式直接进入数据页面来通过
Set oHttp = CreateObject("Msxml2.ServerXMLHTTP")
来取数据了,现在这个网页改版了,不知道怎么得到这个页面的直接数据网址了,请大侠指点。
...全文
224 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
powerc1 2017-06-05
  • 打赏
  • 举报
回复
引用 1 楼 showbo 的回复:
接口判断来源了,要用底层的的WinHttp.WinHttpRequest.5.1,不能用Msxml2.ServerXMLHTTP,这个设置不了来源请求头
   Response.CharSet="utf-8"
    private function BinToString(bin,encoding)
    dim obj
    set obj=Server.CreateObject("Adodb.Stream")
    obj.Type=1:obj.Mode=3:obj.Open
    obj.Write bin
    obj.Position=0:obj.Type=2:obj.Charset=encoding
    BinToString=obj.ReadText
    obj.Close:set obj=nothing
  end function
 
 
    Set oHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
     
    ohttp.open "get","http://www.gxcaipiao.com.cn/xml/notice_12.xml",false
    ohttp.setRequestHeader "Referer","http://www.gxcaipiao.com.cn/notice/notice_12.html"''''''''''''''''''''''''''''''
    ohttp.send(null)
    response.Write "<textarea style='height:500px;width:100%'>"& BinToString(ohttp.ResponseBody,"gb2312")&"</textarea>"
谢谢版主的回答,此贴先结,请在另一贴回复:http://bbs.csdn.net/topics/392172689 谢谢。
Go 旅城通票 2017-06-01
  • 打赏
  • 举报
回复
接口判断来源了,要用底层的的WinHttp.WinHttpRequest.5.1,不能用Msxml2.ServerXMLHTTP,这个设置不了来源请求头
   Response.CharSet="utf-8"
    private function BinToString(bin,encoding)
    dim obj
    set obj=Server.CreateObject("Adodb.Stream")
    obj.Type=1:obj.Mode=3:obj.Open
    obj.Write bin
    obj.Position=0:obj.Type=2:obj.Charset=encoding
    BinToString=obj.ReadText
    obj.Close:set obj=nothing
  end function
 
 
    Set oHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
     
    ohttp.open "get","http://www.gxcaipiao.com.cn/xml/notice_12.xml",false
    ohttp.setRequestHeader "Referer","http://www.gxcaipiao.com.cn/notice/notice_12.html"''''''''''''''''''''''''''''''
    ohttp.send(null)
    response.Write "<textarea style='height:500px;width:100%'>"& BinToString(ohttp.ResponseBody,"gb2312")&"</textarea>"

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧