我的ISP有一个结算页面:https://debet.east.ru/cgi-bin/utm5/aaa5
登录此页面后,我有关于我的帐户的信息。我想自动检查我的余额。
我尝试使用wget
wget -x -o /data/progs/east/345/345log.txt --load-cookies cook.txt --keep-session-cookies --no-check-certificate --output-document=345.html https://debet.east.ru/cgi-bin/utm5/aaa5?login=xxx&password=yyy&submit=OK
日志文件
[root@c12000 345]# cat 345log.txt
--2013-09-02 11:16:20-- https://debet.east.ru/cgi-bin/utm5/aaa5?login=user15003
Resolving debet.east.ru... 195.170.55.4
Connecting to debet.east.ru|195.170.55.4|:443... connected.
WARNING: cannot verify debet.east.ru’s certificate, issued by “/C=GB/ST=Greater
Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO High-Assurance Secure Server CA”
Unable to locally verify the issuer’s authority.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “345.html”
0K . 143K=0.01s
2013-09-02 11:16:20 (143 KB/s) - “345.html” saved [1691]
但是当我检查下载的页面时,我只看到登录页面。我已经检查了两次cookie文件和浏览器中的URL。
为什么不能下载状态页面?
答案 0 :(得分:1)
工作线:
wget -x --no-check-certificate --output-document=345.html \
--post-data 'login=userxxx&password=yyy' \
https://debet.east.ru/cgi-bin/utm5/aaa5
答案 1 :(得分:0)
在某些Ubuntu版本(肯定是14.04服务器)上,使用/ usr / lib / ssl / certs中的默认CA存储编译wget和openssl,而不是/ etc / ssl / certs,其中存在实际的证书。
由symlink修复:
sudo mkdir -p /usr/lib/ssl
sudo ln -s /etc/ssl/certs /usr/lib/ssl/certs