Google 検索結果ページからデータを取得してそのデータを保存する方法 #,
URL からデータを取得するコードがありますが、Google 検索結果からデータを取得できません...
助けてください
URL からデータを取得するコード
enter code here URL iurl = new URL("https://www.google.co.in/search?q=Anirudhcreative%2Cprojects&sub=Submit+Query");
URLConnection urlconn = iurl.openConnection();
System.out.println("url 接続>>:"+urlconn);
File f = new File("Ani 7 hindi gogole out put.html"); //************************************ file name ***
FileOutputStream fop = new FileOutputStream(f); BufferedReader br = new BufferedReader(new InputStreamReader(urlconn.getInputStream())); ストリングライン; //PrintWriter pw = 応答 int ii=0; 文字列 st=""; System.out.println(" * ** * ** * ** * ** * ウェブページの出力 * ** * ** * ** * * "); while((line=br.readLine())!= null) {
System.out.println(""+line+"");
ii++;
st=">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+ii;
System.out.println(">>>>>>>>>"+ii);
if(f.exists()){
fop.write(line.toString().getBytes());
//fop.write(st.toString().getBytes());