webBrowser查寻元素值
webBrowser查找元素值
帮朋友做个winfrom,功能很简单。就是打开淘宝搜索页面,统计关键字的宝贝数量。

HtmlDocument document = this.webBrowser1.Document;
怎么查找到这个 class=‘h’ 值为 527.89W的元素呢?求教谢谢!
------解决方案--------------------
string text;
foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("span"))
{
if (he.GetAttribute("className") == "h")
{
text=he.InnerText
}
}
帮朋友做个winfrom,功能很简单。就是打开淘宝搜索页面,统计关键字的宝贝数量。
HtmlDocument document = this.webBrowser1.Document;
怎么查找到这个 class=‘h’ 值为 527.89W的元素呢?求教谢谢!
------解决方案--------------------
string text;
foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("span"))
{
if (he.GetAttribute("className") == "h")
{
text=he.InnerText
}
}