标题: curl登陆一个网站
[打印本页]
作者: kioskboy
时间: 2008-8-28 19:41
标题: curl登陆一个网站
http://www.netyi.net/是一个又大又好的 电子书下载网站,里面有很多网友上传的资料。但是下载东西一般要积分的(以前刚注册时花过十几块钱),可以发短信和登陆(每天一分)赚积分,所以我每天都要登陆
http://www.netyi.net/jsLoginStatus.aspx一次
由于抓包后是post登陆
考虑了几天,还是登陆不了,不知道错在哪里
echo off
curl -c Cookie_netyi.txt "http://www.netyi.net/jsLoginStatus.aspx"
curl -H "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-icq, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" -d "Content-Type: application/x-www-form-urlencoded UserName=***&Password=***&Submit.x=0&Submit.y=0" -b Cookie_netyi.txt
http://www.netyi.net/jsLoginStat ... c-b265-ed1df0c7114d >>netyi.htm
pause
[
Last edited by kioskboy on 2008-9-7 at 03:53 PM ]
作者: kioskboy
时间: 2008-9-2 19:32
如果curl实现不了,用vbs脚本行吗,双击就能够很快登陆的
作者: HAT
时间: 2008-9-2 23:12
gxsanhen 兄在群里给出了一个autoit的解决方案。
不知能否用vbs实现,呼叫 slore 兄。
作者: kioskboy
时间: 2008-9-3 07:43
autoit 不错,不过还要编译
在没有办法情况下,我才会考虑sendkeys 等类似模拟登陆的方法
curl应该能行吧,有没有人能告诉我用curl到底能登陆这个网站吗,行还是不行啊
作者: ngd
时间: 2008-9-3 20:29
curl -c Cookie_netyi.txt -d "UserName=***&Password=***&Submit=登 录"
http://www.netyi.net/jsLoginStat ... 0-8288-abc376a6a154
::使用正确的账号密码登录,将登录信息保存在 Cookie_netyi.txt 中
作者: slore
时间: 2008-9-4 13:35
Set ie
= CreateObject("
Internetexplorer.Application"
)
ie.Navigate "
http://www.netyi.net/jsLoginStatus.aspx"
ie.Visible
= True
While ie.Busy
or ie.ReadyState
<> 4
Wend
ie.
Document.form2.UserName.value
= "
slore"
ie.
Document.form2.Password.value
= "
slorelee"
ie.
Document.form2.submit
为什么不好好搜索,我是懒的写,如此简单的代码不要告诉我看
不懂。我是按我说的关键字搜索了下点了第2个连接,改了改url,和窗体名而已
就能用,我不知道为什么这么多人喜欢拿来主义……希望不是单单只是和我一样
懒,而是自己可以写出来,起码知道思路可以实现,毕竟这类脚本不是通用的,
可用的地方太少,所以这种针对性的脚本请自己写,不懂就学会搜索……
作者: HAT
时间: 2008-9-4 13:45
slore兄终于出手了,学习。
作者: HAT
时间: 2008-9-4 22:36
标题: Re 6楼
在登陆成功以后,能否再自动点一下“退出”?
我看了一下登陆后的网站代码,“退出”是一个超链接:
<td><img src="images/3003.gif" width="9" height="9"><a href="/quit.aspx?returnUrl=%2fjsLoginStatus.aspx%3fguid%3d0833ef28-c56b-411f-85a4-3ffdf4a81d56">退出</a></td>
作者: qwertl
时间: 2008-9-4 23:31
这样是不是也可登陆些不需验证码的邮箱了??
作者: slore
时间: 2008-9-5 11:33
Set ie
= CreateObject("
InternetExplorer.Application"
)
ie.Navigate "
http://www.netyi.net/quit.aspx?returnUrl=%2fjsLoginStatus.aspx"
ie.Visible
= True '这里设置这个IE对象是否可见。
While ie.Busy
or ie.ReadyState
<> 4:
Wend
ie.
Document.form2.UserName.value
= "
slore"
ie.
Document.form2.Password.value
= "
slorelee"
ie.
Document.form2.Submit
While ie.Busy
or ie.ReadyState
<> 4:
Wend
WSH.Sleep 1000
'这句是叫你能看到登陆成功,没这个直接下面的那句就退出来了。
ie.Navigate "
http://www.netyi.net/quit.aspx?returnUrl=%2fjsLoginStatus.aspx"
While ie.Busy
or ie.ReadyState
<> 4:
Wend
ie.Quit
'自己看情况要不要吧。什么意思自己看的懂。
作者: HAT
时间: 2008-9-5 11:54
学习了,非常感谢!
作者: kioskboy
时间: 2008-9-7 14:59
谢谢大家,谢谢各位高手!