jsoup don't get full data

后端 未结 1 1411
梦毁少年i
梦毁少年i 2021-01-05 12:14

I have a project for school to parse web code and use it like a data base. When I tried to down data from (https://www.marathonbet.com/en/betting/Football/), I didn\'t get i

相关标签:
1条回答
  • 2021-01-05 13:12

    Jsoup has a default body response limit of 1MB. You can change it to whatever you need with maxBodySize(int)

    Set the maximum bytes to read from the (uncompressed) connection into the body, before the connection is closed, and the input truncated. The default maximum is 1MB. A max size of zero is treated as an infinite amount (bounded only by your patience and the memory available on your machine).

    E.g.:

    Document doc = Jsoup.get(url).userAgent(ua).maxBodySize(0).get();
    

    You might like to look at the other options in Connection, on how to set request timeouts, the user-agent, etc.

    0 讨论(0)
提交回复
热议问题