AutoIT Testing Help
Hi I am trying to get a n excel file on the web to save automatically using AutoIT.
The following code is not working:
#include <IE.au3>
$oIE = _IECreate ("http://127.0.0.1/my_site")
_IENavigate ($oIE, "http://databases.about.com/library/samples/address.xls"开发者_如何学C)
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:")
Trying to do it using IE is not the right way.
Have you tried using the InetGet function?
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.")
That works and I get a downloaded spreadsheet with addresses (sounds about right).
Mat
精彩评论