Answer the question
In order to leave comments, you need to log in
401 jsoup error when connecting?
I'm trying to connect to a site and I'm getting this org.jsoup.HttpStatusException: HTTP error fetching URL. Status=401 in try/catch.
String url="https://www.auchan.ru/";
try {
doc = (Document) Jsoup.connect(url).userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
.referrer("http://www.google.com").get();
} catch (Exception e) {
Log.d("items", "ошибка "+e );
return null;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question