Created
May 17, 2019 00:49
-
-
Save jhy/18b4e8f6746fffec35dca9cc4cee9b7b to your computer and use it in GitHub Desktop.
Scratch test case for https://github.com/jhy/jsoup/issues/1196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jsoup.Jsoup; | |
import java.io.IOException; | |
class Scratch { | |
public static void main(String[] args) throws IOException { | |
String html = "<a href=\"http://www.okbih.ba/pdf/financial_guidelines/C%20-%202013-2016%20Financial%20Report.xlsx\">Link</a>"; | |
String link = Jsoup.parse(html).selectFirst("a").attr("href"); | |
byte[] bytes = Jsoup.connect(link) | |
.proxy("localhost", 8888) | |
.ignoreContentType(true) | |
.execute() | |
.bodyAsBytes(); | |
System.out.println(bytes.length); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output is,