找回密码
 加入
搜索
查看: 4838|回复: 10

[IE类操作] [已解决]怎样将网页中的一部分在一个独立的小窗口显示

  [复制链接]
发表于 2011-1-4 07:57:35 | 显示全部楼层 |阅读模式
本帖最后由 lon91ong 于 2011-1-9 11:10 编辑

通常是网页上的flash游戏,想将它放在独立的小窗口运行,不知道要如何做!
望大侠指点!
发表于 2011-1-4 09:05:22 | 显示全部楼层
简单点用iframe,IE库等
高级点post这部份数据,在自己的窗口内交互.
再高级点,自己封装amf
 楼主| 发表于 2011-1-4 09:53:26 | 显示全部楼层
可以给个简单实现的例子吗!
AU3也没有一个系统全面的教程,没有例子,新手不知道如何入手啊!
发表于 2011-1-4 10:00:46 | 显示全部楼层
简单点,自己创建一个界面,然后在窗口里运用ShellExecute(“网址”)
 楼主| 发表于 2011-1-4 11:14:03 | 显示全部楼层
回复 4# 楼上风云

这个是整个网页的方法吧!
而我想要的是网页中的一部分,比如,只要网页中的flash游戏
 楼主| 发表于 2011-1-6 15:36:03 | 显示全部楼层
仍然等待大侠出招中......
发表于 2011-1-6 15:40:39 | 显示全部楼层
ShellExecute(“网址”)
 楼主| 发表于 2011-1-6 17:18:17 | 显示全部楼层
就没有人有源代码吗?

请大侠分享一下源代码吧!
发表于 2011-1-8 22:09:20 | 显示全部楼层
$Form = GUICreate("威海气象局石岛天气情况", 330, 343, -1, -1)
$oIE1 = _IECreateEmbedded ()
GUICtrlCreateObj($oIE1,0, 0, 330, 340)
GUISetState(@SW_SHOW)
_Go()
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd

Func _Go();加载网页
               _IENavigate ($oIE1, @ScriptDir & "/威海气象台信息.htm")
EndFunc
发表于 2011-1-8 22:10:34 | 显示全部楼层
#include <IE.au3>
#include <Array.au3>
#include <String.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <IE.au3>
#include <Array.au3>
#include <Date.au3>
#include <INet.au3>
#include <GUIConstantsEx.au3>

#cs

#CE
$line_1='<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>CNTL提取自威海市气象局</TITLE>' & @CRLF & '<META http-equiv=Content-Type content="text/html; charset=gb2312">' &@CRLF& '<BODY class=nomarl_page>' &@CRLF

;$oIE = _IECreate ("http://www.vipshop.com/detail-46289-360-0.html", 0, 0,1,0)
TrayTip("CNTL程序开始","正在提取威海气象局发布的信息",30,1)
$oIE = _IECreate ("http://www.whqxj.com/", 0,0,1,0)

;MsgBox(0,"",$html_TXT)
$html=_IEDocReadHTML($oIE)
;$html_TXT=_IEBodyReadText ($oIE)
;$file_ok = FileOpen("威海气象台信息.txt", 10)
;FileWriteLine($file_ok, $html_TXT& @CRLF)
;FileClose($file_ok)

;Local $aArray1_TXT = _StringBetween($html_TXT, '石岛'&@CRLF, @CRLF&@CRLF&@CRLF&'成山头'&@CRLF)
;$html_shidao=_ArrayToString($aArray1_TXT)
;$html_shidao=StringStripWS($html_shidao, 8)




Local $aArray1 = _StringBetween($html, '<DIV id=石岛>', '</TR></TBODY></TABLE></TD></TR>')
Local $aArray2 = _StringBetween($html, '<DIV id=yubao_title>威海市气象台', '发布')
;_ArrayDisplay($aArray1, 'Default Search')
$html=_ArrayToString($aArray1)
$html=StringReplace($html, "/images/slide_top_bg.gif", "http://www.whqxj.com/images/slide_top_bg.gif")
$htm2=_ArrayToString($aArray2)
$htm2='<DIV id=yubao_title>威海气象台'& $htm2 & '发布</DIV>'
$html=$line_1 & '<DIV id=石岛>'& $html& @CRLF&'<IMG src="http://www.whqxj.com/images/slide_buttom.gif"></TBODY></TABLE></TD></TR>' &@CRLF& $htm2& '</BODY></HTML>'

Local $aArray1_trip = _StringBetween($html, '<TD align=middle width=93 height=16>','</TD>')
;_ArrayDisplay($aArray1_trip, 'Default Search')
$24hour=$aArray1_trip[0] & ":"&$aArray1_trip[3] &" "&  $aArray1_trip[6] &" "& $aArray1_trip[9] & @CRLF
;MsgBox(0,"",$24hour)
$48hour=$aArray1_trip[1] & ":"&$aArray1_trip[4] &" "&  $aArray1_trip[7] &" "& $aArray1_trip[10] & @CRLF
$72hour=$aArray1_trip[2] & ":"&$aArray1_trip[5] &" "&  $aArray1_trip[8] &" "& $aArray1_trip[11] 
$hour= StringMid($24hour,1) & StringMid($48hour,1) & StringMid($72hour,1) 

Local $aArray1_trip2 = _StringBetween($html, '<DIV id=yubao_title>','</DIV>')
$hour=  "石岛气象信息:"& @CRLF&$hour 
TrayTip( _ArrayToString($aArray1_trip2) ,$hour,30,1)
;TrayTip("数组提取石岛气象信息",$hour,30,1)
;sleep(4000)
$i=0
$file_ok = FileOpen("威海气象台信息.htm", 10)
; 检查打开的文件是否可写
If $file_ok = -1 Then
    MsgBox(16, "错误", "不能写入文件”唯品历史记录.txt“。")
    Exit
EndIf
FileWriteLine($file_ok, $html& @CRLF)
;FileWriteLine($file_ok, "【"& _Now() & "】"& "程序运行结束" & @CRLF)
;FileWriteLine($file_ok, "*********************************************************")
FileClose($file_ok)
;Run("Notepad.exe 威海气象台信息.htm", "", @SW_MAXIMIZE)
;Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE 威海气象台信息.htm", "", @SW_MAXIMIZE)
;Run("威海气象台信息.htm")

;Run("Notepad.exe", @ScriptDir & "/威海气象台信息.htm", @SW_MAXIMIZE)

$Form = GUICreate("威海气象局石岛天气情况", 330, 343, -1, -1)
$oIE1 = _IECreateEmbedded ()
GUICtrlCreateObj($oIE1,0, 0, 330, 340)
GUISetState(@SW_SHOW)
_Go()
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd

Func _Go();加载网页
               _IENavigate ($oIE1, @ScriptDir & "/威海气象台信息.htm")
EndFunc

Exit

评分

参与人数 1金钱 +20 收起 理由
lon91ong + 20 多谢大侠!

查看全部评分

 楼主| 发表于 2011-1-9 11:09:13 | 显示全部楼层
多谢楼上给的源码,慢慢啃了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-13 08:25 , Processed in 0.103706 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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