How can I download the first few lines of an html document? I have tried jsoup and httpclient but it seems that I still have to download开发者_运维问答 the full document. I only want some text from about the 15th line of a page and I would rather not have to download the entire several hundred line document to get it. This is being run from a service that updates a home screen widget.
Such thing isn't availaible in the HTTP protocol. The only thing you can do is to use custom socket implementation to connect to the server directly and close the connection after receiving the data you want.
精彩评论