是否可以使用 AutoHotkeys 在网站上提交表单数据?

是否可以使用 AutoHotkeys 在网站上提交表单数据?

我设置了热键,以便突出显示外语(法语、西班牙语、德语)中的单词,并且根据热键,我可以对其进行变位、听人发音或在上下文中定义它。但是,我想用来对德语动词进行变位的网站不会在 URL 中提交该单词。我最喜欢这个变位器:https://deutsch.lingolia.com/en/grammar/conjugator我对 Jquery 了解不多,也不太了解如何使用热键在此页面的表单数据中提交动词。有人知道这是否可行吗?我可以使用 URL 方法处理许多动词变位器,但我想使用此网站。

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#f::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/fr""
Return
#g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/de/""
Return
#s::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://forvo.com/search/"%clipboard%"/es/""
Return

#!f::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
;MsgBox, %totranslate% = %clipboard%
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/french-english/"%totranslate%"
Return

#!g::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/german-english/"%totranslate%"
Return

#!s::
clipboard=
send, ^c
ClipWait, .5
StringReplace, totranslate, clipboard, %A_Space%, +, All
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://context.reverso.net/translation/spanish-english/"%totranslate%"
Return

+#g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.verbix.com/webverbix/German/"%clipboard%".html""
Return

+#f::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.collinsdictionary.com/dictionary/french-english/conjugation/"%clipboard%"
Return

+#s::
clipboard=
send, ^c
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""http://www.spanishdict.com/conjugate/"%clipboard%"
Return

#+!g::
clipboard=
send, {ctrl down}c{ctrl up}
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""https://en.wiktionary.org/wiki/"%clipboard%"#Declension""
Return

答案1

你可以模仿人类使用网站的方式:

+#s::
clipboard=
send, ^c
ClipWait, .5
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://deutsch.lingolia.com/en/grammar/conjugator"

WinWait, Conjugate German Verbs - Lingolia German - Google Chrome, 
IfWinNotActive, Conjugate German Verbs - Lingolia German - Google Chrome, , WinActivate, Conjugate German Verbs - Lingolia German - Google Chrome, 
WinWaitActive, Conjugate German Verbs - Lingolia German - Google Chrome, 
MouseClick, left,  460,  399
Sleep, 100
Send, {TAB}{CTRLDOWN}v{CTRLUP}{ENTER}


Return

相关内容