3
我想創建一個應用程序,發送一個單詞到translate.google.com,採取翻譯的結果並顯示給用戶。我編寫了URL,但我不知道如何從網頁中提取單詞/短語。如何使用谷歌翻譯API從代碼
例僞: EN是英語和ES代碼爲西班牙
String from = "en";
String to = "es";
String word = "hello"; //this will be user input text really
String URL = "http://www.translate.google.com/#" + from + "/" + to + "/" + word;
代碼因此請求的URL看起來像http://www.translate.google.com/#en/es/hello
我現在需要能夠來檢索信息結果框並將其放置在一個字符串中,以便我可以將其顯示給用戶。
由於現在谷歌翻譯API已經支付,不可能通過HTTP請求獲得結果嗎? – 2013-07-30 23:58:55