How do you Programmatically Download a Webpage in Java

前端 未结 11 2239
无人共我
无人共我 2020-11-22 11:20

I would like to be able to fetch a web page\'s html and save it to a String, so I can do some processing on it. Also, how could I handle various types of compr

11条回答
  •  被撕碎了的回忆
    2020-11-22 12:02

    Well, you could go with the built-in libraries such as URL and URLConnection, but they don't give very much control.

    Personally I'd go with the Apache HTTPClient library.
    Edit: HTTPClient has been set to end of life by Apache. The replacement is: HTTP Components

提交回复
热议问题