SHARE
TWEET

ProxyScraper

a guest Aug 23rd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.net.*;
  3. import org.jsoup.Jsoup;
  4. import org.jsoup.nodes.Document;
  5. import org.jsoup.nodes.Element;
  6.  
  7. public class ProxyScrapeParser {
  8.    
  9.     public static void parseHttpProxy(String path) throws IOException {
  10.         URL url = new URL(Sites.PROXY_SCRAPE);
  11.        
  12.         BufferedInputStream bis = new BufferedInputStream(url.openStream());
  13.         FileOutputStream fos = new FileOutputStream(path);
  14.        
  15.         byte[] data = new byte[1024];
  16.         int byteContent;
  17.        
  18.         while((byteContent = bis.read(data, 0, 1024)) != -1) {
  19.             fos.write(data, 0, byteContent);
  20.         }
  21.        
  22.         fos.flush();
  23.         fos.close();
  24.        
  25.         System.out.println("DONE");
  26.     }
  27.    
  28. }
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