You can use a method WebClient.DownloadStringthat allows you to set HTTP request headers to load the contents of a web page, and then use it with the HTML flexibility package.
UserAgent does not control the language. This is the headline Accept-Language. For example:
using (var client = new WebClient())
{
client.Headers[HttpRequestHeader.AcceptLanguage] = "es-ES";
client.Headers[HttpRequestHeader.UserAgent] = "some user agent if you wish";
string html = client.DownloadString("http://example.com");
var doc = new HtmlDocument();
doc.LoadHtml(html);
}
But if the site uses IP-based recognition to send you content in different languages, you cannot do this on the client side to change this.
source
share