mainly, i have loged into facebook using webview. so, i don't know which cookies for which urls are saved into CookieManager. i don't know whether it is possible or not, but i have know idea how to do it.
now, i need to get a page using Jsoup. but i need to pass some cookie also to get the page, otherwise server will return me an error pager.
i want it with Jsoup, because i need some information from the page
i have trying something like this, but all the time i am getting the error page:
Map<String, String> cookies = new HashMap<String, String>();
cookies.put(domain1, my_cookie1);
cookies.put(domain2, my_cookie2);
cookies.put(domain3, my_cookie3);
cookies.put(domain4, my_cookie4);
Document doc = Jsoup.connect(uri.toString())
.cookies(cookies)
.timeout(10000)
.get();
Log.e("title", doc.title());
my_cookie
's are get from CookieManager. and they are not null, because i have printed them.
i think the problem is with cookies. or not? is there any solution. i think i am missing some cookie from CookieManager.
i need to get the page.
Edited:
or, is it possible to pass the cookimanager to Jsoup ? so, that it can take the cookie from cookiemanager directly. or, can i know which cookies are needed for getting my desire page?