There are two Listen buttons (source language and destination language). The unique characterisation of these buttons is that they are a
div
element with
src-tts
as class for the source and
res-tts
for the result (amongst other classes). So loop over the elements and check for said class:
HtmlElement sourceListenButton = null;
foreach (HtmlElement h in webBrowserGoogleTranslate.Document.GetElementsByTagName("div"))
{
if (h.GetAttribute("class").Contains("src-tts"))
{
sourceListenButton = h;
break;
}
}
if (sourceListenButton == null)
{
}