Friday, 15 May 2015

java - How do I send a cookie while trying to grab a sites source? -


I am trying to capture the source code of the site using this code

  Private static string throws getUrlSource (string URL) IOException {URL url = new URL (url); URL Connection URLConnect = url.openConnection (); BufferedReader = New BufferedReader (New InputStreamReader (urlConn.getInputStream (), "UTF-8"); String inputline; StringBuilder A = new stringbilder (); While ((inputLine = in.readline ()) = null) a.append (inputLine); In.close (); Return a.toString (); }  

When I capture the site code, I get an error to allow cookies. Is there anyway to allow cookies in any Java application, so I Can I get some source code? If I help, then I use the cookie to use my browser.

Thanks John

In this way you will have to deal with raw request data, its Go along, you are intangible and


No comments:

Post a Comment