Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.net.*;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Document;
- import org.jsoup.nodes.Element;
- public class ProxyScrapeParser {
- public static void parseHttpProxy(String path) throws IOException {
- URL url = new URL(Sites.PROXY_SCRAPE);
- BufferedInputStream bis = new BufferedInputStream(url.openStream());
- FileOutputStream fos = new FileOutputStream(path);
- byte[] data = new byte[1024];
- int byteContent;
- while((byteContent = bis.read(data, 0, 1024)) != -1) {
- fos.write(data, 0, byteContent);
- }
- fos.flush();
- fos.close();
- System.out.println("DONE");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement