Вопрос 1: Почему возвращается такой html?
Вопрос 2: Не совсем понимаю что вообще должно вернутся, куки?
Вопрос 3: Как с помощью того что вернется мне быть авторизированным и получить необходимую информацию со страницы?
Заранее спасибо, тема новая, разбираюсь плохо
form со страницы:
Код: Выделить всё
<form action="" method="post" name="auth">
<input type="hidden" name="redirect" value="/main.html">
<div border="0" align="left">
<p>Логин:</p>
<div class="login_field"><input style="width:300px; height: 25px;" type="text" name="oper_user" id="oper_user" maxlength="30"></div>
<script type="text/javascript">
$(document).ready(function(){
$(':text').keyboardLayout();
});
</script>
<p>Пароль:</p>
<div class="login_field"><input style="width: 300px; height: 25px" type="password" name="passwd" maxlength="32"></div>
<script type="text/javascript">
$(document).ready(function(){
$(':password').keyboardLayout();
});
</script>
<br>
<a href="/forgetpass.html">Забыли пароль?</a>
<br><br>
<div class="center"><input type="submit" style="display:inline" class="btn" value="Войти">
</div>
</div>
</form>Код: Выделить всё
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://issa.beltelecom.by/main.html");
try {
// определяешь элементы массива POST
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("oper_user", "**********"));
nameValuePairs.add(new BasicNameValuePair("passwd", "*******"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// выполняешь POST-запрос
HttpResponse response = httpclient.execute(httppost);
String s = EntityUtils.toString(response.getEntity());
Log.d("My", s);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}Код: Выделить всё
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /main.html
on this server.</p>
</body></html>