找回密码
 加入
搜索
查看: 3474|回复: 8

[IE类操作] 大家看看怎么样修改跳转代码

  [复制链接]
发表于 2011-10-19 14:00:01 | 显示全部楼层 |阅读模式
以下代码我想要它每次打开http://www.hao123.com    5秒之后就 跳转到  http://www.baidu.com  应该怎么样修改呢?是每一次哦~~~~~~~~~~



$a = 0
While 1
        Sleep(400)
        $oShell = ObjCreate('shell.application')
        $oShellWindows = $oShell.windows

        If $a = 0 And ProcessExists("iexplore.exe") Then
                For $Window In $oShellWindows
                        If StringInStr($Window.locationurl, 'http://www.hao123.com', 2) Then
                                                        Sleep(5000)
                                $Window.navigate('http://www.baidu.com')
                                $a = 1
                        EndIf
                Next
        ElseIf $a = 0 And ProcessExists("iexplore.exe") Then
                ContinueLoop
        Else
                $a = 1
                ContinueLoop
        EndIf
WEnd
发表于 2011-10-19 14:18:28 | 显示全部楼层
#include <IE.au3>
$oIE = _IECreate("http://www.hao123.com")
Sleep(5000)
_IENavigate($oIE, "http://www.baidu.com")
 楼主| 发表于 2011-10-19 14:32:36 | 显示全部楼层
你这个是自动打开网址了的,我要鼠标点才会变的
发表于 2011-10-19 23:40:26 | 显示全部楼层
你这个是自动打开网址了的,我要鼠标点才会变的
ylsfwb 发表于 2011-10-19 14:32


楼主是想做广告,好讨厌你们!
While 1
        Sleep(400)
        $oShell = ObjCreate('shell.application')
        $oShellWindows = $oShell.windows

        If ProcessExists("iexplore.exe") Then
                For $Window In $oShellWindows
                        If StringInStr($Window.locationurl, 'http://www.hao123.com', 2) Then
                                                        Sleep(5000)
                                $Window.navigate('http://www.baidu.com')
                        EndIf
                Next
        EndIf
WEnd
 楼主| 发表于 2011-10-21 02:57:26 | 显示全部楼层
谢谢~~~
发表于 2011-10-21 12:18:47 | 显示全部楼层
是要在IE下吗?  可以用BHO
 楼主| 发表于 2011-10-24 14:56:04 | 显示全部楼层
怎么用BHO,发代码出来看看!!
发表于 2011-10-25 05:59:32 | 显示全部楼层
本帖最后由 netegg 于 2011-10-25 06:02 编辑

先不管整个脚本的运行情况, 麻烦楼主高人能否先解释下
第7行:   If $a = 0 And ProcessExists("iexplore.exe") Then
第15行: ElseIf $a = 0 And ProcessExists("iexplore.exe") Then
这两句的逻辑关系是什么, 如果第一个if 成立,第二个为什么不成立,反之,如果第一个不成立,第二个为什么成立
发表于 2011-11-12 23:41:19 | 显示全部楼层
他是想做个跳转的来赚外快,呵呵,他的条件重复了,888666的代码循环里面记得要加循环,不然一关网页就报找不到对象的错误,可以用注册COM错误捕获函数解决!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 01:54 , Processed in 0.079600 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表