找回密码
 加入
搜索
查看: 3821|回复: 6

[IE类操作] 如何在au3里只显示ie设定网站的某一个位置的内容?[已解决]

  [复制链接]
发表于 2011-10-24 21:33:31 | 显示全部楼层 |阅读模式
本帖最后由 mtvtop 于 2011-12-3 00:28 编辑
Func _go()
_IENavigate ($oIE,"http://www.qq.com/")
EndFunc


$TabSheet1 = GUICtrlCreateTabItem("网页")
$oIE = _IECreateEmbedded ()


$GUIActiveX = GUICtrlCreateObj($oIE,15,30,1000,600)
如何只显示今日话题部分的内容?
发表于 2011-10-24 22:09:18 | 显示全部楼层
#include <GUIConstants.au3>
#include <IE.au3>
GUICreate("Test", 875, 400)
$oIE = _IECreateEmbedded () 
$GUIX = GUICtrlCreateObj($oIE, 0, 20, 875, 250)
_IENavigate ($oIE, "")
GUISetState(@SW_SHOW)   
$Url = 'http://www.qq.com/'
$oHTTP = ObjCreate('microsoft.xmlhttp')
$oHTTP.Open('get', $Url, False)
$oHTTP.Send()
$str = BinaryToString($oHTTP.responseBody)
Local $Test = StringRegExp($str, '<!--今日话题-->((?s).+)<!--今日话题 end-->', 3)
_IEDocWriteHTML ($oIE, $Test[0])

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE       ;==>退出事件
            Exit
    EndSelect
WEnd
 楼主| 发表于 2011-10-24 22:26:27 | 显示全部楼层
回复 2# lynfr8


    这个是提取代码!
我想要的不是通过网页提取,就有点想html里的 ifram 这样的。
如果我要提取的部分是flash呢?用这个好像取不出来吧
发表于 2011-10-24 22:34:02 | 显示全部楼层
本帖最后由 lynfr8 于 2011-10-24 22:36 编辑

回复 3# mtvtop
#include <GUIConstants.au3>
$Obj = ObjCreate("ShockwaveFlash.ShockwaveFlash.9")
If @error Then Exit
GUICreate("嵌入flash测试by afan", 800, 400)
$control = GUICtrlCreateObj($Obj, 10, 30, 780, 300)
If $control = 0 Then Exit (MsgBox(0, "Error", "Error"))
GUISetState()
$Obj.Movie = "http://flash.weather.com.cn/sk2/shikuang.swf?id=101010100"
$Obj.Play()
While 1
        $msg = GUIGetMsg()
        Select
                Case $msg = $GUI_EVENT_CLOSE
                        OnExit()
        EndSelect
WEnd

Func OnExit()
        GUIDelete()
        Exit
EndFunc   ;==>OnExit

http://www.autoitx.com/thread-9628-1-1.html
发表于 2011-10-24 22:47:20 | 显示全部楼层
本帖最后由 lynfr8 于 2011-10-24 22:48 编辑

回复 3# mtvtop

你不提取源代码你怎么显示?
网页框架不是堆积木你想随便搬哪一块就搬哪一块的
你要做到原来那部分一模一样的话还牵涉到css和js脚本
先去学学网页的基本知识和DOM吧
 楼主| 发表于 2011-10-24 23:01:23 | 显示全部楼层
回复 4# lynfr8

再问一下,我想把状态栏不显示出来要怎么写呢?
发表于 2011-10-24 23:46:03 | 显示全部楼层
回复 6# mtvtop


    _IEPropertySet

"statusbar" 指定表示浏览器状态栏是否可见的值.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-1 12:16 , Processed in 0.082408 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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