i'm using the following code to save the content of some webpages in a method, but i keep having the error which says : ("Cannot make a static reference to the non-static method convertor() from the type ConvertUrlToString")
please consider i just used this class to find the problem of my main project where i have the similar method ( convertor() ) in another class without "public static void main(String args[])"
package testing;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class ConvertUrlToString {
public static void main(String args[]) throws IOException{
convertor();
}
public void convertor() throws IOException
{
Document doc = Jsoup.connect("http://www.willhaben.at/iad/immobilien/mietwohnungen/wien/wien-1060- mariahilf/").get();
String text = doc.body().text();
Document doc1 = Jsoup.connect("http://www.google.at/").get();
String text1 = doc1.body().text();
Document doc2 = Jsoup.connect("http://www.yahoo.com/").get();
String text2 = doc2.body().text();
System.out.println(text);
System.out.println(text1);
System.out.println(text2);
}
}