X
X
xaiponews2020-12-10 00:12:49
Android
xaiponews, 2020-12-10 00:12:49

How to pass cookies to Jsoup?

There is a certain site viewed in webview, in onPageFinished using CookieManager I was able to take cookies and pass them to String. Now I want to parse this same site using Jsoup and store it in a document so I can pull elements later. How to pass this String( i.e. cookie) to session Document doc = Jsoup.connect("Url").get(); , since Jsoup does not use cookies from the webview, but uses its own pure session.

webView.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageFinished(WebView view, String url) {

                String cookies =  CookieManager.getInstance().getCookie(url);

                Log.d("cookies", "куки : " + cookies);
            }
        });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-12-13
@zagayevskiy

.cookie () between connect and get tried to call?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question