【发布时间】:2016-04-03 02:58:46
【问题描述】:
我必须在工作中向第 3 方供应商网站提出一些状态请求。每天500-600次。我正在尝试自动执行此任务。目前我的代码使用以下方法。
; 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())
我在网上搜索并找到了URLDownloadToFile,并阅读了文档here。但这不起作用,因为我需要的供应商网站信息是通过表单请求的,它没有我可以使用的静态网站链接。
我当前的方法有效,但是速度很慢,因为我在必须阅读的每一页上都使用了额外的 2-3 秒,并且我的程序在运行时会闪烁蓝白色(来自副本和粘贴)。是否有其他解决方案可以从 Internet Explorer 页面加载中读取文本,而不使用复制、粘贴、读取剪贴板方法?
【问题讨论】:
标签: internet-explorer automation autohotkey