单击 bash 中的 webform 按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/11767775/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Click webform button from bash
提问by spizzak
I'm trying to "click" a button on a webpage from a bash script. I was told to try using curl but I've not been able to figure it out. I don't need to fill out any input info, just simulate navigating to a page and clicking a button (login is also necessary).
我正在尝试从 bash 脚本“单击”网页上的按钮。有人告诉我尝试使用 curl,但我无法弄清楚。我不需要填写任何输入信息,只需模拟导航到页面并单击按钮(也需要登录)。
Here is the output of formfind:
这是formfind的输出:
server:$ ~/formfind < ./site.html 
--- FORM report. Uses GET to URL "/view/job/26/search/"
Input: NAME="q" VALUE="search" (TEXT)
--- end of FORM
--- FORM report. Uses POST to URL "Job/pass"
Button: "Execute" (SUBMIT)
--- end of FORM
--- FORM report. Uses POST to URL "Job/fail"
Button: "Execute" (SUBMIT)
--- end of FORM
I'm trying to click the "Execute" button under either Pass or Fail
我正在尝试单击“通过”或“失败”下的“执行”按钮
回答by Jure C.
You'll need this: https://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request
你需要这个:https: //superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request
Use web inspector or a proxy to check what exactly is being sent.
使用网络检查器或代理来检查究竟发送了什么。

