◎自动踩百度博客的脚本(VBS版)

前一阵子玩模拟精灵,里面有一段代码可以自动踩百度博客,增加回访,代码紧凑细致,效率极高。今天下午忽发奇想,用vbs来实现一下自动踩百度博客。尽管实现了,但是总感觉走了弯路,没有模拟精灵效率高,方法简洁。因为是用于演示,所以只收集了9个页面的博客地址,每次访问也是从头开始,有兴趣的朋友,可以自己修改相应的代码。希望百度管理员不要封我,我没有恶意,呵呵。

code1

On Error Resume Next

url="http://hi.baidu.com/hi/good0"

'str="http://hi.baidu.com.xuejinglan"

Set ie=WScript.CreateObject("InternetExplorer.Application")

ie.visible=True

atlink=""

For i=1 To 9 Step 1

urll=url & i &".html"

ie.navigate urll

    While ie.Busy

     WScript.Sleep 100

    Wend

Set links=ie.Document.links

Set fso = CreateObject("Scripting.FileSystemObject")

Set f=fso.OpenTextFile("c:/url.txt",8,True)

For Each link In links

If link<>atlink And link<>"http://www.baidu.com/" And

link<>"http://hi.baidu.com/"

And link<>"http://www.baidu.com/search/hi_contract.html" And

link<>"http://www.baidu.com/duty/" And reg(link)<>true Then f.WriteLine link

atlink=link

Next

f.Close

Next

Function reg(str)

Dim regEx, Match, Matches

      Set regEx = New RegExp

           regEx.Pattern = "^http://hi.baidu.com/hi/good"

           regEx.IgnoreCase = True

           regEx.Global = True

Val = regEx.Test(str)

reg =Val

End Function

将此段代码保存为:取得地址.vbs,执行可得到百度空间各博客的地址。

code2:

'str="http://hi.baidu.com.xuejinglan"

Set Wshell=WScript.CreateObject("WScript.Shell")

Set ie=WScript.CreateObject("InternetExplorer.Application")

ie.visible=true

ie.navigate "http://passport.baidu.com/"

Do

Wscript.Sleep 200

Loop Until ie.ReadyState=4

ie.document.getElementById("username").value="xxxxxxx"

ie.document.getElementById("password").value="*******"

tj=ie.document.getElementsBytagname("form")

tj.submit

WScript.Sleep 10000

Set fso = CreateObject("Scripting.FileSystemObject")

Set f=fso.OpenTextFile("c:/url.txt",1,false)

Do While f.AtEndOfLine <> True

url=f.ReadLine

Set ie=WScript.CreateObject("InternetExplorer.Application")

ie.visible=True

ie.navigate url

Do

    Wscript.Sleep 200

Loop Until ie.ReadyState=4

WScript.Sleep 10000

ie.Quit

Loop

将此段代码保存为:踩空间.vbs,执行即可。

 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值