js안 소스
/** The original page id sent from the server */
dwr.engine._origScriptSessionId = "D6AFC8506B0A573B02043DD2E35E3541";
/** The read page id that we calculate */
dwr.engine._scriptSessionId = null;
/** The function that we use to fetch/calculate a session id */
dwr.engine._getScriptSessionId = function() {
if (dwr.engine._scriptSessionId == null) {
dwr.engine._scriptSessionId = dwr.engine._origScriptSessionId + Math.floor(Math.random() * 1000);
}
return dwr.engine._scriptSessionId;
};
//소스
response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
((DefaultHttpClient)httpClient).getCookieStore().addCookie(cookie.get(0));
BufferedReader br = null;
String line = null;
String session = null;
try {
br = new BufferedReader(new InputStreamReader(entity.getContent(),"utf-8"));
while((line = br.readLine()) != null) {
if(line.contains("dwr.engine._origScriptSessionI"))
{
session=line.split("\"")[1];
break;
}
}
} finally {
if(br != null) try { br.close(); } catch(Exception e) {}
}
그냥 scriptSessionId 부분은 값 하나 대충 구해서 그거 하나 고정된 값으로 보내. 어차피 랜덤이라 서버에서는 그 값이 유효한 값인지 체크 못해
D6AFC8506B0A573B02043DD2E35E3541638 그냥 이거 보내. "638"이라는 랜덤 값이 뒤에 붙은 거임.
새로고침할떄마다 바뀌길래 이거때문에지금까지 안되는줄알았는데 다른값 보내주는거도 잘못된거같다
데이터에 문제가 있는 게 아니라 서버에서 Referer이랑 User-Agent 헤더 값을 체크하고 있는 것일 수도 있음.
최종적으로 내가뽑아야할값은 dwr로 js변수안에들어가는데 js변수에 직접접근은못하나