首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AutoIT测试帮助

AutoIT测试帮助
EN

Stack Overflow用户
提问于 2011-04-29 05:20:45
回答 1查看 639关注 0票数 1

您好,我正在尝试得到一个网上的excel文件,以自动保存使用AutoIT。

以下代码不起作用:

代码语言:javascript
复制
#include <IE.au3>
$oIE = _IECreate ("http://127.0.0.1/my_site")
_IENavigate ($oIE, "http://databases.about.com/library/samples/address.xls")

WinWait("File Download","Do you want to open or save this file?")
ControlClick("File Download","Do you want to open or save this file","Button2")
WinWait("Save As","Save &in:")
EN

回答 1

Stack Overflow用户

发布于 2011-04-30 18:45:49

尝试使用IE来做这件事不是正确的方法。

您尝试过使用InetGet函数吗?

代码语言:javascript
复制
Local $sFileName = FileSaveDialog("Save excel file...", @MyDocumentsDir, "Excel spreadsheet (*.xls)|All Files (*.*)", 18, "address.xls")
If @error Then Exit ; User cancelled the dialog

Local $iBytes = InetGet("http://databases.about.com/library/samples/address.xls", $sFileName, 8)
MsgBox(0, "Worked :)", "File downloaded. " & $iBytes & " downloaded.")

这样就行了,我得到了一个下载的电子表格,上面有地址(听起来差不多)。

垫子

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5825186

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档