Advertisement
Guest User

Untitled

a guest
May 26th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1.  
  2. import java.net.*;
  3. import java.io.*;
  4. import java.util.StringTokenizer;
  5. import java.util.Scanner;
  6.  
  7. public class Main {
  8.  
  9. public void HtmlCookie() throws Exception {
  10. URL url = new URL("https://www.google.kz/");
  11.  
  12. HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  13. connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6");
  14. connection.setRequestProperty("Cookie", "uname=AQAAANCMnd8BFdERjHoAwE%2fCl%2bsBAAAAdEBpNRprKkuhk%2fnIwaLLPgQAAAACAAAAAAADZgAAqAAAABAAAADZqjhvec%2bV30HPxZ7khpUvAAAAAASAAACgAAAAEAAAAEQ9EI8%2bQHNdK8RjqtcJRrYgAAAAIbTnx5Q0HjHreoZn8Q5TIVluiwUapbiqYZY%2fdYYzC84UAAAApN%2bIOFgfcLv7r%2fLO3wV4hPG%2f%2bOM%3d;");
  15. connection.connect();
  16.  
  17. String inputLine;
  18. Scanner in = new Scanner(new InputStreamReader(connection.getInputStream(), "UTF8"));
  19. //public String st[] = new String[400000];
  20. int y=0;
  21. while(in.hasNextLine()) {
  22.  
  23. inputLine = in.nextLine();
  24. //System.out.println(inputLine);
  25. work p = new work(inputLine);
  26. p.work();
  27.  
  28. //st[y]+=p.show();
  29. y++;
  30. }
  31. in.close();
  32. }
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement