【问题标题】:AutoIT Testing HelpAutoIT 测试帮助
【发布时间】:2011-04-28 21:20:44
【问题描述】:

您好,我正在尝试在网络上获取一个 n excel 文件,以便使用 AutoIT 自动保存。

以下代码不起作用:

#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:")

【问题讨论】:

  • 什么不起作用?有错误吗?能否请您分享更多细节。

标签: testing autoit


【解决方案1】:

尝试使用 IE 来做这件事是不对的。

您是否尝试过使用 InetGet 函数?

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.")

这行得通,我下载了一个带有地址的电子表格(听起来差不多)。

垫子

【讨论】:

    猜你喜欢
    • 2011-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-15
    相关资源
    最近更新 更多