Thursday, August 26, 2010

Grab from Internet

If u want to scrap or grab any thing from internet just use this code ..........

Java Scrapping code :


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;




public class Grab {
public static void main(String a[]) throws IOException
{
String url="http://yahoo.com";
URL u=new URL(url);
URLConnection uc=(HttpURLConnection) u.openConnection();
DataInputStream br = new DataInputStream(new BufferedInputStream(uc
.getInputStream()));

int len;
while ((len = br.read()) != -1){
System.out.println((char)len);
}}
}


Just change the "url" variable alone to grab from any other sites.

1 comment:

  1. I'm 15 years old. I was born with HIV my mother passed away because of the HIV infection And I regret why i never met Dr Itua he could have cured my mum for me because as a single mother it was very hard for my mother I came across Dr itua healing words online about how he cure different disease in different races diseases like HIV/Aids Herpes Copd Diabetes Hepatitis even Cancer I was so excited but frighten at same time because I haven't come across such thing article online then I contacted Dr Itua on Mail drituaherbalcenter@gmail.com I also chat with him on what's app +2348149277967 he tells me how it works then I tell him I want to proceed I paid him so swiftly Colorado post office I receive my herbal medicine within 4/5 working days he gave me guild lines to follow and here am I living healthy again can imagine how god use men to manifest his works am I writing in all articles online to spread the god work of Dr Itua Herbal Medicine Yes can ask me anything about this on my twitter @ericamilli or text 7205992850.He's a Great Man.

    ReplyDelete