您好,我正在尝试得到一个网上的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:")发布于 2011-04-30 18:45:49
尝试使用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.")这样就行了,我得到了一个下载的电子表格,上面有地址(听起来差不多)。
垫子
https://stackoverflow.com/questions/5825186
复制相似问题