hello everyone, i want to download the source code of the webpage . i have used URL method and Jsoup method but not getting the exact data as mentioned in actual source code . for example-
<input type="image" name="ctl00$dtlAlbums$ctl00$imbAlbumImage" id="ctl00_dtlAlbums_ctl00_imbAlbumImage" title="Independence Day Celebr..." border="0" onmouseover="AlbumImageSlideShow('ctl00_dtlAlbums_ctl00_imbAlbumImage','ctl00_dtlAlbums_ctl00_hdThumbnails','0','Uploads/imagegallary/135/Thumbnails/IMG_3206.JPG','Uploads/imagegallary/135/Thumbnails/');" onmouseout="AlbumImageSlideShow('ctl00_dtlAlbums_ctl00_imbAlbumImage','ctl00_dtlAlbums_ctl00_hdThumbnails','1','Uploads/imagegallary/135/Thumbnails/IMG_3206.JPG','Uploads/imagegallary/135/Thumbnails/');" src="Uploads/imagegallary/135/Thumbnails/IMG_3206.JPG" alt="Independence Day Celebr..." style="height:79px;width:148px;border-width:0px;" /
>
in this tag the last attribute style is not detecting by the code of jsoup. and if i am downloading it from URL method it changes the style tag in border=""/> attribute.
can any body tell me the way to download the exact source code of a webpage.
my code is-
URL url=new URL("http://www.apcob.org/");
InputStream is = url.openStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line;
File fileDir = new File(contextpath+"\\extractedtxt.txt");
Writer fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileDir), "UTF8"));
while ((line = br.readLine()) != null)
{
fw.write("\n"+line);
}
InputStream in = new FileInputStream(new File(contextpath+"extractedtxt.txt";));
String baseUrl="http://www.apcob.org/";
Document doc=Jsoup.parse(in,"UTF-8",baseUrl);
System.out.println(doc);
second method i followed is-
Document doc = Jsoup.connect(url_of_currentpage).get();