Omer K Omer K - 16 days ago 5
C# Question

WebClient DownloadString is not downloading content exactly same as the web page

I am trying to use google translate web page as below:

string url = String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text=Hello&langpair=en|tr");
WebClient webClient = new WebClient();
string result = webClient.DownloadString(url);


The problem is, when I look at google chrome developer tools, inspect elements, the actual page content is a little different from the downloaded string. I want to get alternate texts from google translate but
webClient.DownloadString(url)
does not download them.

Why are these two different, what can I do to download the web page content as I see on the browser?

enter image description here

Answer

This is ajax call. Why do not you check out the google api

enter image description here