I\'m trying to use JSoup to scrape some pages that are on a staging server. To view the pages on the staging server with a browser I need to be connected to a VPN.
I
To add on for ollo if your proxy needs username/password authentication.
final String authUser = ;
final String authPassword = ;
Authenticator.setDefault(
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
authUser, authPassword.toCharArray());
}
}
);
System.setProperty("http.proxyHost", );
System.setProperty("http.proxyPort", );
System.setProperty("http.proxyUser", authUser);
System.setProperty("http.proxyPassword", authPassword);
Document doc = Jsoup.connect("http://your.url.here").get();