jsoup icon indicating copy to clipboard operation
jsoup copied to clipboard

Please create PROGRESS method

Open crysan opened this issue 9 years ago • 7 comments

Hi,

Can you implement a method of progress? It is necessary to indicate the progress of the html page downloaded.

Thanks

crysan avatar Nov 16 '15 05:11 crysan

Can you please detail what you expect?

Stephan972 avatar Aug 22 '16 12:08 Stephan972

Example:

Document doc = Jsoup.connect("http://example.com") .userAgent("Mozilla") .timeout(3000) .onProgress (long totalBytes, long downlaodedBytes, int progress){ tada(); } .post();

crysan avatar Aug 23 '16 04:08 crysan

What the int progress parameter is supposed to contain?

The code in the example is invalid Java code. Can you adress this?

What happen if the total size is unknown?

On Tue, Aug 23, 2016 at 6:47 AM +0200, "Sani" [email protected] wrote:

Example:

Document doc = Jsoup.connect("http://example.com") .userAgent("Mozilla") .timeout(3000) .onProgress (long totalBytes, long downlaodedBytes, int progress){ tada(); } .post();

You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/jhy/jsoup/issues/656#issuecomment-241625625

Stephan972 avatar Aug 23 '16 05:08 Stephan972

int progress = 0(%) - 100(%) downloaded

The code in the example is invalid Java code. Can you adress this? I know. Just gave the example of the approximate realization to obtain information about how to download the object.

What happen if the total size is unknown? At the beginning of the boot progress = 0. At the end of progress = 100. The intermediate result is unknown.

crysan avatar Aug 23 '16 05:08 crysan

Please clarify the code with a valid Java example.

In the case of an unknown total size, what value progress should contain?

On Tue, Aug 23, 2016 at 7:26 AM +0200, "Sani" [email protected] wrote:

int progress = 0(%) - 100(%) downloaded

The code in the example is invalid Java code. Can you adress this? I know. Just gave the example of the approximate realization to obtain information about how to download the object.

What happen if the total size is unknown? At the beginning of the boot progress = 0. At the end of progress = 100. The intermediate result is unknown.

You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/jhy/jsoup/issues/656#issuecomment-241630217

Stephan972 avatar Aug 23 '16 05:08 Stephan972

Yes I know what you mean, like in the Android Progress methods. Good idea, thanks!

On Mon, Aug 22, 2016, 22:24 Sani [email protected] wrote:

int progress = 0(%) - 100(%) downloaded

The code in the example is invalid Java code. Can you adress this?

I know. Just gave the example of the approximate realization to obtain information about how to download the object.

What happen if the total size is unknown?

At the beginning of the boot progress = 0. At the end of progress = 100. The intermediate result is unknown.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jhy/jsoup/issues/656#issuecomment-241630217, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEshl_OS2cjWdsrLu1uMqkPjATsj9xXks5qioQdgaJpZM4Giuog .

jhy avatar Aug 23 '16 05:08 jhy

It I think this could be implemented by just returning the position of the byte stream every time an element is hit

burtonator avatar Feb 08 '17 00:02 burtonator