正在加载...
2010-3
5
发表于: IT | 作者: wxy_332
标签:

下面是替换网页里字符的代码
Dim webdoc As HTMLDocument
Dim texbody As HTMLBody
Dim Rng As IHTMLTxtRange
On Error Resume Next
Set webdoc = m_IE.Document
Set texbody = webdoc.body
Set Rng = texbody.createTextRange()
Do
If Rng.FindText(“情色”) = False Then Exit Do
Rng.Select
Rng.pasteHTML “过滤”
Loop

**********************************

替换链接:

Dim i As Integer
For i = webdoc.links.length – 1 To 0 Step -1
If InStr(1, webdoc.links(i).outerHTML, “http://www.sex.com”, vbTextCompare) Then
webdoc.links(i).outerHTML = “<a href=’http://www.maxthon.com/’>http://www.maxthon.com/</a>”
End If
Next
**********************************
替换FORM提交地址

  1. dim cForm
  2. set cForm = webdoc.getElementsByTagName(“form”)
  3. if cForm.length>0 then
  4. For i = cForm.length – 1 To 0 Step -1
  5. If InStr(1, cForm(i).outerHTML, “http://www.sex.com”, vbTextCompare)>0 Then
  6. cForm(i).outerHTML = “<a href=’http://www.maxthon.com/’>http://www.maxthon.com/</a>”
  7. End If
  8. Next
  9. end if
  10. set cForm = Nothing

声明:部分文章不代表本站观点,版权归原作者所有。

: http://www.cnwxy.info/archives/540

本文相关评论 - 1条评论都没有呢

还没有任何评论。