I have been trying to access KissAnime however, i kept receiving this error:
org.jsoup.HttpStatusException: HTTP error fetching URL. Status=503
When i tried another URL eg. https://www.google.com/, it works perfectly.
This is my asynctask code:
@Override
protected Void doInBackground(Void... params) {
try {
// Connect to the web site
Document document = Jsoup.connect("https://kissanime.to/AnimeList/")
.ignoreContentType(true)
.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1")
.referrer("http://www.google.com")
.timeout(12000)
.followRedirects(true)
.get();
// Get the html document title
title = document.title();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Any idea how to solve this problem?
To get rid of 503, below code would be useful.
public static void main(String[] args) throws IOException {
//This will get you out of Http 503
Document document = Jsoup.connect("https://kissanime.to/AnimeList/")
.userAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0").ignoreHttpErrors(true).followRedirects(true).timeout(100000).ignoreContentType(true).get();
System.out.println(document.body());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With