Помогите пожалуйста, пытаюсь спарсить со страницы картинку, но бросает эксепшин на строке
Document doc = connection.url("
4pda.ru/forum/index.php?").get();
Что я делаю не так?
mContext = context;
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = inflater.inflate(R.layout.login, null);
username_edit = (EditText) mView.findViewById(R.id.username_edit);
captcha_edit = (EditText) mView.findViewById(R.id.captcha_edit);
captcha_image = (ImageView) mView.findViewById(R.id.captcha_image);
password_edit = (EditText) mView.findViewById(R.id.password_edit);
privacy_checkbox = (CheckBox) mView.findViewById(R.id.privacy_checkbox);
String ClassName = "ipbtable";
try {
String url = "http://4pda.ru/forum/index.php?act=Login&CODE=01";
Connection connection=Jsoup.connect(url);
connection.method(Connection.Method.GET);
connection.referrer("http%3A%2F%2F4pda.ru%2Fforum%2Findex.php%3F");
connection.ignoreHttpErrors(true);
connection.timeout(1000);
connection.data("act", "login");
Connection.Response res = connection.execute();
Document doc = connection.url("http://4pda.ru/forum/index.php?").get();
Elements wrapper = doc.select(ClassName).eq(0);
Elements img = wrapper.select("img").eq(0);
String imageUrlStr = img.attr("src");
Bitmap mIcon11 = null;
URL newUrl = new URL(imageUrlStr);
URLConnection urlConn = newUrl.openConnection();
InputStream stream = urlConn.getInputStream();
mIcon11 = BitmapFactory.decodeStream(stream);
captcha_image.setImageBitmap(mIcon11);
} catch (Exception e) {
e.printStackTrace();
}