本文介绍了[C#] [gecko]从span类中获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好!所以,我正在使用用C#编写的Gecko(firefox)浏览器创建一个项目。我被困在一个特定的事情上。我想获得没有ID的span类的文本。以下是代码:[]
我尝试了几种方法来拍摄这张照片数据,但似乎没有任何工作....谷歌这是它可以得到我。有任何想法吗 ?提前致谢。
我尝试了什么:
我尝试过获取所有类元素并循环遍历它们以及其他一些东西。
var links = GeckoWB.Document.GetElementsByTagName( span);
foreach ( var link in 链接)
{
if (link.GetAttribute( ipsNotificationCount ipsHide)== data-currentcount )
{
}
}
解决方案
Hello ! So, i am creating a project using Gecko(firefox) browser written in C#. I am stuck at a specific thing. I want to get the text of a span class, which doesn't have an ID. Here is the code:
[^]
I tried several ways to take this piece of data, but nothing seems work.... and google this is as far as it could get me. Any ideas ? Thanks in advance.
What I have tried:
I tried to get all class elements and loop through them, and some other stuff.
var links = GeckoWB.Document.GetElementsByTagName("span"); foreach (var link in links) { if (link.GetAttribute("ipsNotificationCount ipsHide") == "data-currentcount") { } }
解决方案
这篇关于[C#] [gecko]从span类中获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!