I have to do some status request to a 3rd party vendor website at work. It is 500-600 times per day. I am trying to automate this task. Currently my code uses the following method.
; Helper function to get the text from current web page
CurrentScreen() {
Sleep, 500
MouseClick, left, 880, 240
Send, {CTRLDOWN}a{CTRLUP}
Sleep, 500
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 500
return Clipboard
}
; Helper function to read at line number X and return text
GetInformation(webpageBuffer) {
If (A_Index == 30)
; Do something here and return data
}
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
wb.Navigate("www.someVendor.com")
IELoad(wb)
; Do a lot of clicking and searching
someText := GetInformation(CurrentScreen())
I searched online and found URLDownloadToFile and I read the documentation here. But this does not work, because the vendor website information I need is requested via a form, it does not have a static website link I can use.
My current method work, but it is rather slow, since I have am using additional 2-3 seconds on for each page I have to read, and my program will flash blue and white while it is running (from the copy and paste). Is there other solution to read text from an Internet Explorer page load, that does not use the copy, paste, read clipboard method?