预览模式: 普通 | 列表

VB网页采集方案

用com对象动态创建技术,即可在VB程序中创建一个IE,然后访问需要的网址,等待加载完毕,然后就可以十分方便地得到完整的源码

ASP/Visual Basic代码
  1. Function GetFullHtml(vURL As StringAs String  
  2.       
  3.     Dim ie As Object  
  4.     Dim element As Object  
  5.       
  6.     Set ie = CreateObject("InternetExplorer.Application")  
  7.       
  8.     With ie  
  9.         .Visible = False  
  10.         .navigate vURL  
  11.         Do Until .Readystate = 4  
  12.             DoEvents  
  13.         Loop  
  14.         GetFullHtml = .Document.body.innerhtml  
  15.     End With  
  16.   
  17.     Set ie = Nothing  
  18.       
  19. End Function  

Tags: vb

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2241

asp返回404错误状态码

ASP/Visual Basic代码
  1. <%  
  2.    Response.Status = "404 Not Found"  
  3. %>

 

Tags: asp

分类:技术文章 | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 2569

 广告位

↑返回顶部↑