【发布时间】:2018-10-09 09:25:51
【问题描述】:
我正在尝试使用 https://www.tutorialspoint.com/online_java_formatter.htm 格式化我的 java 代码。但我在从 textarea 获取文本时遇到问题。我正在尝试从以下 textarea 获取文本。
<textarea class="ace_text-input" style="width: 6.59px; height: 14.05px; right: 428.4px; bottom: 511.79px; opacity: 0;" spellcheck="false" wrap="off"></textarea>
自动热键代码:
;code beautifier java
^+b::
Send ^c
formatter := "https://www.tutorialspoint.com/online_java_formatter.htm"
(pwb2 := ComObjCreate("InternetExplorer.Application")).Visible:=True
pwb2.navigate(formatter)
while pwb2.busy
sleep 15
pwb2.document.getElementsByTagName("textarea")[0].value=Clipboard
pwb2.document.getElementById("beautify").Click()
sleep 5000
Clipboard := pwb2.document.getElementsByTagName("textarea")[1].innerHTML
Send, ^v
pwb2.quit()
Return
【问题讨论】:
-
你到底面临什么问题?
-
此代码无法从 textarea 获取文本值。当我尝试使用 MessageBox 显示剪贴板变量时,messagebox 显示空白文本
标签: html automation autohotkey