找回密码
 加入
搜索
查看: 1607|回复: 3

[IE类操作] 各位版主老大帮我把这段代码改一下。用hao123.com打开让它不出现新窗口

[复制链接]
发表于 2010-10-21 16:00:29 | 显示全部楼层 |阅读模式
本帖最后由 yang3114 于 2010-11-1 17:08 编辑

#include <IE.au3>
_IEErrorHandlerRegister()
Global $oIE = _IECreateEmbedded()
$url = "http://www.hao123.com"
GUICreate("test", 700, 600, (@DesktopWidth - 700) / 2, (@DesktopHeight - 600) / 2)
GUICtrlCreateObj($oIE, 0, 0, 700, 600)
_IENavigate($oIE, $url)
_replace()
GUISetState()

Do
        $nurl = _IEPropertyGet($oIE, "locationurl")
        If $nurl <> $url Then
                _replace()
                $url = $nurl
        EndIf
        Sleep(10)
Until GUIGetMsg() = -3


Func _replace()
        Local $body, $string
        _IELoadWait($oIE)
        $body = _IEBodyReadHTML($oIE)
        $string = StringRegExpReplace($body, '\btarget=_blank', 'target=_self')
        $string = StringRegExpReplace($string, '\btarget="_blank"', 'target=_self')
        _IEBodyWriteHTML($oIE, $string)
EndFunc   ;==>_replace
 楼主| 发表于 2010-10-21 17:03:54 | 显示全部楼层
等待风行者,快点出现吧
 楼主| 发表于 2010-11-1 17:09:18 | 显示全部楼层
求版主进来帮我改一下。
 楼主| 发表于 2010-11-2 06:42:30 | 显示全部楼层
这个问题没人能够解决吗,论坛里的高手呢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 16:16 , Processed in 0.076312 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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