以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何获取网页内容部分 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=185451) |
-- 作者:xluoping -- 发布时间:2023/2/23 18:14:00 -- 如何获取网页内容部分 以下代码 url 获取的是该网页的全部代码,如何过滤掉<>,只需要内容 \'\'\' Dim url As String Dim http As New Object try url = "https://www.qcc.com/web/search?key=%E8%87%B4%E4%BF%A1%E6%A3%80%E6%B5%8B%E6%8A%80%E6%9C%AF" http = CreateObject("MSXML2.XMLHTTP") http.Open("get", url, False) http.send() url = http.responseText If url.Contains("image.qcc.com/auto/") AndAlso url.Contains(".jpg") Then url = url.SubString(url.IndexOf("image.qcc.com/auto/") + 19) url = url.SubString(0,url.IndexOf(".jpg")) try url = "https://www.qcc.com/firm/" & url & ".html" http = CreateObject("MSXML2.XMLHTTP") http.Open("get", url, False) http.send() url = http.responseText Catch exi As Exception End try End If Catch exi As Exception End try FileSys.WriteAllText(ProjectPath & "123.txt",url,False) |
-- 作者:尘埃落定 -- 发布时间:2023/4/3 21:59:00 -- 同问 |