java[get/post]访问遇到javascript的问题

俺木加加 发布于 2015/07/12 12:58
阅读 395
收藏 0

我要爬一个政府网站:http://www.pbc.gov.cn/

然后我请求后,他返回:

<html><head></head><body><noscript><h1><strong>请开启JavaScript并刷新该页.</strong></h1></noscript><script type="text/javascript">eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>32?String.fromCharCode(c+32):c.toString(33))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('14 C="j";14 19="h";14 1a="k";14 10=b;14 E = "d+/=";I f(Z) {14 T, M, Q;14 n, o, p;Q = Z.R;M = 0;T = "";16 (M < Q) {n = Z.r(M++) & 6;N (M == Q) {T += E.q(n >> a);T += E.q((n & 1) << b);T += "==";m;}o = Z.r(M++);N (M == Q) {T += E.q(n >> a);T += E.q(((n & 1) << b) | ((o & 5) >> b));T += E.q((o & 4) << a);T += "=";m;}p = Z.r(M++);T += E.q(n >> a);T += E.q(((n & 1) << b) | ((o & 5) >> b));T += E.q(((o & 4) << a) | ((p & 3) >> c));T += E.q(p & 2);}V T;}I G(){14 15= 18.P||A.B.t||A.l.t;14 J= 18.O||A.B.s||A.l.s;N (15*J <= 9) {V 13;}14 1c = 18.X;14 1d = 18.Y;N (1c + 15 <= 0 || 1d + J <= 0 || 1c >= 18.W.17 || 1d >= 18.W.L) {V 13;}V F;}I g(){14 11 = 19+1a;14 K = 0;14 M    = 0;H(M = 0; M < 11.R; M++) {K += 11.r(M);}K *= 7;K += 8;V "i"+K;}I e(){N(G()) {} D {14 w = ""; w = "1b="+f(10.12()) + "; U=/";A.v = w; 14 u = g();w = "19="+f(u.12()) + "; U=/";A.v = w; 18.S=C;}}e();',59,73,'0|0x3|0x3f|0xc0|0xf|0xf0|0xff|11|111111|120000|2|4|6|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|HXXTTKKLLPPP5|KTKY2RBD9NHPBCIHV9ZMEQQDARSLVFDU|QWERTASDFGXYSF|RANDOMSTR732|WZWS_CONFIRM_PREFIX_LABEL4|/|STRRANDOM732|body|break|c1|c2|c3|charAt|charCodeAt|clientHeight|clientWidth|confirm|cookie|cookieString|document|documentElement|dynamicurl|else|encoderchars|false|findDimensions|for|function|h|hash|height|i|if|innerHeight|innerWidth|len|length|location|out|path|return|screen|screenX|screenY|str|template|tmp|toString|true|var|w|while|width|window|wzwschallenge|wzwschallengex|wzwstemplate|x|y'.split('|'),0,{}))</script></body></html>

这如何是好,在浏览器就能正常请求,用java爬就提示:请开启JavaScript并刷新该页.

加载中
1
王爵nice
王爵nice
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:zh-CN,zh;q=0.8,en;q=0.6
Cache-Control:max-age=0
Connection:keep-alive
Cookie:wzwsconfirm=14aafb48fada10ac5218fdcde1ac5d0c; wzwstemplate=Mg==; ccpassport=bb39e279cbc4c615d4b62227ad60b5f1; wzwschallenge=-1
Host:www.pbc.gov.cn
If-Modified-Since:Sun, 12 Jul 2015 07:17:22 GMT
RA-Sid:65E5188E-20140722-151509-619d97-ada059
RA-Ver:3.0.1
Referer:http://www.pbc.gov.cn/
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36



俺木加加
俺木加加
不知道他是根据哪个参数判断的
俺木加加
俺木加加
我加了还是不行啊
0
俺木加加
俺木加加
是不是要在header里面设置了什么参数。。。
0
Feng_Yu
Feng_Yu
你只能手工格式化那段js代码,读懂那段js代码的算法,看看那段js究竟做了什么操作
返回顶部
顶部