0

what I´m doing is this:

Document page = Jsoup.connect(url).timeout(0).get();
Elements elements= pageSubforum.select(elements);

Sometimes this is working, but often I get a

java.net.SocketTimeoutException

How can I handle this?

Sarah Xoxo
  • 115
  • 6

1 Answers1

0

I could actually solve it. The problem was not the connection, it was the parsing method.

int timeout = 0;
Jsoup.parse(url, timeout);

The timeout has to be set to zero, so Jsoup interprets it as an infinite timeout. Hope I can help someone with this in the future.

Sarah Xoxo
  • 115
  • 6