使用wget登录网页


0

我使用wget登录此网页时遇到问题:

http://dealers.volare-kinderfietsen.nl/index.php?dispatch=auth.login_form

通常这对我来说没问题。我只想在登录此页面时存储cookie。我用:

wget --save-cookies cookies.txt --keep-session-cookies --post-data =“user_login = myloginname& password = mypassword”“ http://dealers.volare-kinderfietsen.nl/index.php?dispatch=auth.login_form

但由于某种原因,它不允许我登录此表单。我搜索了一些,这个页面是一个cs购物车网上商店系统...也许有人有这方面的一些信息?

提前致谢

Answers:


1

我对CS-Cart并不熟悉,但在检查链接页面的HTML时,我注意到表单中的以下两个隐藏字段:

<input type="hidden" name="form_name" value="main_login_form" />
<input type="hidden" name="return_url" value="index.php?dispatch=auth.login_form" />

如果不在网站上创建帐户,我无法确定,但考虑到表单标记的目标是 /,你似乎需要至少包括 form_name 字段的值(如果不是两者)在POST中,以便CS-Cart知道如何处理表单数据。


谢谢亚伦;好的,我将查询更改为:wget --save-cookies cookies.txt --keep-session-cookies --post-data =“form_name = main_login_form&amp; return_url = index.php?dispatch = auth.login_form&amp; user_login = mylogin&amp;密码= mypass“” dealers.volare-kinderfietsen.nl/... “但没有运气....我在return_url的值中有问号是否重要?
Peter

没关系,没关系。您可能希望使用Firebug的网络面板或Wireshark或等效的数据包分析工具,以查看从实际页面发出的POST请求中的确切内容。也许有一些Javascript在将表单数据发送到服务器之前将其复制,在这种情况下,您需要在自己的请求中复制其效果才能获取登录cookie。
Aaron Miller

mmmm lo luck ..在firebug中我只有帖子项:dispatch [auth.login] Inloggen form_name main_login_form密码******* return_url index.php?dispatch = auth.login_form user_login ******** *我尝试添加所有这些参数...没有运气和没有javascript :(
Peter
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.