Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Document;
- import org.jsoup.nodes.Element;
- import org.jsoup.select.Elements;
- public class DownloadProxyList {
- public static List<ProxyServer> list = new ArrayList<ProxyServer>();
- private static Document getDocument(String url) throws IOException {
- Document doc = Jsoup.connect(url).get();
- return doc;
- }
- public static class ProxyServer{
- private String host;
- private int port;
- public String getHost() {
- return host;
- }
- public int getPort() {
- return port;
- }
- public void setHost(String host) {
- this.host = host;
- }
- public void setPort(int port) {
- this.port = port;
- }
- }
- public static void main(String[] args) throws IOException {
- Document document = getDocument("http://spys.one/proxylist/");
- Element table = document.select("table").get(1);
- Elements rows = table.select("tr.spy1xx");
- for (Element element : rows) {
- Elements info = rows.select("td");
- String host = info.get(0).text();
- }
- System.out.println("DONE");
- }
- public static void setInformation(String host , String port) throws IOException {
- FileWriter fw = new FileWriter("C:\\Users\\samsung\\Desktop\\row.txt");
- fw.write(host + " " + port);
- fw.flush();
- fw.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement