I want to translate a string using Google Translator.
My sample string "this is my string".
I want to use HTML Agility Pack to parse HTML documents.
I tried this:
using HtmlAgilityPack;
........
var webGet = new HtmlWeb();
var document = webGet.Load(
"http://translate.google.com/#en/bn/this%20is%20my%20string");
var node = document.DocumentNode.SelectNodes(
"//span[@class='short_text' and @id='result_box']");
if (node != null)
{
foreach (var xx in node)
{
x = xx.InnerText;
MessageBox.Show(x);
}
}
But I do not get any results.
My goal is to translate the complete string using Google Translate and show the translated string in a shortcut in Windows Forms.
How can i do this?
user1960072
source
share