웹 페이지에 로그인해서 데이터를 좀 가져오려고 합니다.
JSOUP 라이브러리를 사용하구 있구요.
web page의 소스는 아래와 같은데 아무리 시도해봐도 로그인을 정상적으로 하지 못하는것 같네요..ㅠㅠ
혹시 조언 좀 해주실분 계신가요..1?
<!-- loginWindow -->
<div id="loginWindow" class="loginWindow">
<!-- class="loginWindow" | class="loginWindow open" -->
<span class="modalWindow"></span>
<div id="loginLayer" class="loginLayer">
<div class="social_login">
</div>
<div class="clear"></div>
<!-- class="loginLayer loginTypeA" | class="loginLayer loginTypeB" -->
<button type="button" class="close" onclick="document.getElementById('loginWindow').style.display='none'" accesskey="X"><span>Close Login Layer</span></button>
<form action="http://www.ddanzi.com/" method="post" class="typeA" id="commonLogin" onsubmit="return procFilter(this, login)"><input type="hidden" name="error_return_url" value="/index.php?mid=free&act=dispMemberLoginForm" /><input type="hidden" name="act" value="dispMemberLoginForm" /><input type="hidden" name="mid" value="free" /><input type="hidden" name="vid" value="" />
<fieldset>
<legend>XE Login</legend>
<dl>
<dt><label for="uid"><img src="/layouts/layouts_ddanzi/images/login/login_id.png" /></label></dt>
<dd><input name="user_id" type="text" class="inputText" id="uid" /></dd>
<dt><label for="upw"><img src="/layouts/layouts_ddanzi/images/login/login_pass.png" /></label></dt>
<dd><input name="password" type="password" class="inputText" id="upw" /></dd>
<dd><input type="checkbox" name="keep_signed" id="keepid" value="Y" title="로그인 유지">로그인유지</dd>
</dl>
<div class="loginButton"><input name="" type="image" src="/layouts/layouts_ddanzi/images/login/login.jpg" /></div>
<div class="clear"></div>
</fieldset>
</form>
<div class="clear"></div>
<button type="button" class="close" onclick="document.getElementById('loginWindow').style.display='none'" accesskey="X"><span>Close Login Layer</span></button>
</div>
</div>
<!-- /loginWindow -->
제 android source는 아래와 같습니다......ㅠㅠ
Connection.Response res = Jsoup.connect("http://www.ddanzi.com/index.php?mid=free&act=dispMemberLoginForm")
.followRedirects(true)
.data("user_id", "myid")
.data("password", "mypassword")
.method(Connection.Method.POST)
.execute();
Document document = Jsoup.connect("http://www.ddanzi.com/index.php?act=dispMemberInfo")
.followRedirects(true)
.cookies(res.cookies())
.method(Connection.Method.POST)
.post();