For Each objWindow In objApp.Windows
If (InStr(objWindow.Name, "Internet Explorer")) Then
Set objIE = objWindow
Exit For
End If
With objIE
.Visible = True 'Make sure to set the window of IE to visible.
Set objDoc = objIE.Document
Do While .Busy Or .readyState <> 4
'Do nothing, wait for the browser to load.
Do While .Document.ReadyState <> "complete"
'Do nothing, wait for the VBScript to load the document of the website.
Do While True
Wscript.Sleep time
objDoc.Location.Reload(True)
End With
'Clear the objects.
On Error Resume Next
objApp = Nothing
objIE = Nothing
objWindow = Nothing
2011年01月02日
[b][b]IE[/b][/b][b][b]定期
刷新
网页的[/b][b]
VBS
[/b][b]
脚本
[/b]
[/b]On Error Resume Next
Set objExplorer = CreateObject("InternetExplorer.Application") objExplorer.Navig...
按回车键,网页即可自动
刷新
。
如果你想在更短的
时间
内执行这个操作,可以使用
浏览器
的快捷键。例如,在 Google Chrome
浏览器
中,可以按下 Ctrl + F5 来
刷新
网页。
需求:某个网页的登录具有时效性,一段
时间
不操作就会推出登录。并且只是简单F5
刷新
的话,一段
时间
之后,可能会由于异次元的乱流导致地址栏跳转到有点关系却又莫名其妙的地址。
方案:采用
vbs
脚本
模拟按键,就不需要像其他
语言
一样准备运行和编码环境了。
可以根据各自需要修改里面的各项等待
时间
,单位为毫秒,1000毫秒=1秒。
使用流程如下:
在运行
脚本
前,先手动复制一下当前的网站
页面
地址。
双击脚...
了,每次都去清空缓存,再
刷新
看效果,这样操作太麻烦了。在IE下我们可以直接
去修改internet选项/常规/浏览历史记录/到internet临时文件选项的
设置
中,将检查网页中的较新版
本改成每次访问...
我可以回答这个问题。您可以使用
vbs
脚本
中的"SetCursorPos"函数来控制鼠标移动。该函数需要传递鼠标的x和y坐标作为参数。例如,以下代码将鼠标移动到屏幕上的坐标(100,100)处:
SetCursorPos 100, 100