Excel VBA获取网页内容
1、Function getWebString(sUrl As String)Dim HttpReq As ObjectSet HttpReq = CreateObject("MSXML2.ServerXMLHTTP")HttpReq.Open "GET", sUrl, FalseHttpReq.sendgetWebString = HttpReq.responseTextEnd Function
2、可以在表格里面以公式的形式来使用,如
=getWebString("https://www.baidu.com/s?wd=cc")
就可以得到指定页面的源码数据了
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:21
阅读量:128
阅读量:54
阅读量:54
阅读量:70