如何在需要身份验证的页面上使用wget

我一直在搜索有关wget的信息,并找到了许多关于如何使用wget登录具有登录页面的网站的文章。该网站使用https,登录页面查找的表单字段为“userid”和“password”。我通过在按F12时检查Chrome中的网络工具来验证了这一点。

我一直在使用以下文章作为指南:

http://www.unix.com/shell-programming-and-scripting/131020-using-wget-curl-http-post-authentication.html

wget with authentication

我尝试过的:

testlab:/lua_curl_tests# wget --save-cookies cookies.txt --post-data 'userid=myid&password=123123' https://10.123.11.22/cgi-bin/acd/myapp/controller/method1
wget: 无法识别选项 `--save-cookies'
BusyBox v1.21.1 (2013-07-05 16:54:31 UTC) multi-call binary.

还有

testlab/lua_curl_tests# wget
http://userid=myid:123123@10.123.11.22/cgi-bin/acd/myapp/controller/method1
连接到10.123.11.22 (10.123.11.22:80) wget:服务器返回错误:HTTP / 1.1 403 Forbidden

你能告诉我我做错了什么吗?最终,我想做的是登录,提交数据,然后获取结果页面。我还在查看curl-看看我是否应该使用curl(lua-curl)来完成此操作。

点赞