2 come on air come_on_air 于 2015.05.25 16:27 提问

php curl采集高手请进

http://www.lecai.com/ 这个网站怎么用php/url技术进行模拟登录?求参考程序。。。。。

5个回答

u010517901
u010517901   2015.05.25 22:37
已采纳

我大致看了一下,个人习惯使用Snoopy.class.php模拟登陆,觉得不好可以忽略

POST http://www.lecai.com/user/ajax_login.php HTTP/1.1
Host: www.lecai.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Accept: application/json, text/javascript, /; q=0.01
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://www.lecai.com/user/login/?from=head_nav
Content-Length: 73
Cookie: SESSIONID=vqnhvxldgdnrplde; _lcas_uuid=267434368; _lhc_uuid=sp_55633310b6aee1.99725102; Hm_lvt_ddaa40fe0ef9967e65e6956736d327af=1432564498,1432564627; Hm_lpvt_ddaa40fe0ef9967e65e6956736d327af=1432564631; LSID=5uj2vi7ihberorifvmoj3231d6; _adwb=238723590; _adwc=238723590; _adwp=238723590.4690203763.1432564611.1432564611.1432564611.1; _adwr=238723590%23http%253A%252F%252Fask.csdn.net%252Fquestions%252F184619; lehecai_request_control_stats=2
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

username=123&passwd=123&verify=2643&referer=http%3A%2F%2Fwww.lecai.com%2F


$snoopy = new Snoopy();
$url = 'http://www.lecai.com/user/ajax_login.php';
$form = array(
'username' =>$username,
'passwd' =>$password,
)
$snoopy->submit($url,$form);


come_on_air
come_on_air cookie是怎么获取到的?
2 年多之前 回复
dowebs
dowebs   2015.06.16 17:14

一般的流程是这样,选用登录页面,再分析获得验证码的图片地址,读取验证码的图片存在本地,
对验证码图片进行去噪和二极化后,再通过OCR插件识别,获得验证码,当然这得需要验证码字型是比较规则的,
当提交后收到验证码错误后,还要循环尝试,一般来说,准确率保持在5%以上,就基本可以认定这种验证码破解是成功的,
因为机器刷新验证码20次一般不是大问题。

devmiao
devmiao   Ds   Rxr 2015.05.25 23:08

用fiddler调试看下抓包结果

come_on_air
come_on_air   2015.05.26 09:06

还有验证码怎么获取?能讲解一下么?

qq36451767
qq36451767   2015.05.26 11:54

回复come_on_air: 自己登陆之后然后用按F12 获取

come_on_air
come_on_air 验证码呢?
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片