SHARE
TWEET

asdas

a guest Aug 20th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. import org.jsoup.Jsoup;
  5. import org.jsoup.nodes.Document;
  6. import org.jsoup.nodes.Element;
  7. import org.jsoup.select.Elements;
  8.  
  9. public class DownloadProxyList {
  10.    
  11.     public static List<ProxyServer> list = new ArrayList<ProxyServer>();
  12.    
  13.     private static Document getDocument(String url) throws IOException {
  14.         Document doc = Jsoup.connect(url).get();
  15.         return doc;
  16.     }
  17.    
  18.     public static class ProxyServer{
  19.         private String host;
  20.         private int port;
  21.        
  22.         public String getHost() {
  23.             return host;
  24.         }
  25.        
  26.         public int getPort() {
  27.             return port;
  28.         }
  29.        
  30.         public void setHost(String host) {
  31.             this.host = host;
  32.         }
  33.         public void setPort(int port) {
  34.             this.port = port;
  35.         }
  36.        
  37.     }
  38.    
  39.     public static void main(String[] args) throws IOException {
  40.         Document document = getDocument("http://spys.one/proxylist/");
  41.         Element table = document.select("table").get(1);
  42.        
  43.         Elements rows = table.select("tr.spy1xx");
  44.        
  45.         for (Element element : rows) {
  46.             Elements info = rows.select("td");
  47.             String host = info.get(0).text();
  48.            
  49.         }
  50.         System.out.println("DONE");
  51.     }
  52.    
  53.     public static void setInformation(String host , String port) throws IOException {
  54.         FileWriter fw = new FileWriter("C:\\Users\\samsung\\Desktop\\row.txt");
  55.         fw.write(host + " " + port);
  56.         fw.flush();
  57.         fw.close();
  58.     }
  59.    
  60. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top