如何從谷歌搜索結果頁面retrive數據並保存數據#,
我有代碼以檢索從URL中的數據,但我不能retrive數據從谷歌的搜索結果 ...如何從Google搜索結果頁中檢索數據並保存該數據,是否有可能?
plz幫助我
代碼從URL retrive數據
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 connection >>:」+ 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 = respons int ii = 0; String st =「」; 的System.out.println(」 * ** * ** * ** * ** *網頁輸出* ** * ** * ** * *「); 而((線= 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())。
歡迎來到SO。 'www.nic.in/hindi/projects'不是谷歌,那麼你是什麼意思?請妥善格式化您的代碼。 – home