basically, I went to facebook using webview. therefore, I do not know what cookies for which URLs are stored in the CookieManager. I donβt know if this is possible or not, but I know how to do it.
Now I need to get the page using Jsoup. but I need to send some cookie in order to get the page, otherwise the server will return an error pager to me.
I want it with Jsoup because I need information from the page
I have something like this, but all the time I get a page with an error:
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 are obtained from CookieManager. and they are not null because I printed them.
I think the problem is with cookies. or not? is there any solution. I think I'm missing a cookie from CookieManager.
I need to get a page.
Edited by:
or is it possible to pass cookimanager to Jsoup? so that it can accept cookies from cookiemanager directly. or, can I know what cookies are needed to get my wish page?
source share