この例を使用すると、C#HTMLElementのGetAttributeを使用してこの行の「GOOGLECLICK」を取得するにはどうすればよいですか。この要素がgetElementByTagNameを使用して吸収されたと仮定します。使用する属性の種類がわかりません。Javaで機能する" html "& " text "(ex。element.GetAttribute( "html") )属性を試しましたが、残念ながらc#では機能しません。
<a href="www.google.com">GOOGLE CLICK</a>
参考までに、実行しようとしているc#のサンプルコードを示します。
//web is the current page i am at.
HtmlElementCollection links = web.Document.GetElementsByTagName("a");
foreach (HtmlElement link in links)
{
if (link.GetAttribute("text") == "GoogleClick")
MessageBox.Show(this, "Hooray I got it!");
}