[已解决] c#Htmlelement类属性 [英] [Solved] c# Htmlelement Class attribute

查看:478
本文介绍了[已解决] c#Htmlelement类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似
的代码部分
< a href ="asda" class ="urun_baslik">某些文本</a>
我想要一些带有Webbrowser控件的文本.

我可以使用该getattribute("classname")并返回urun_baslik.

那么,我该如何获取某些文本!

更新:
OP自己找到了答案并将其发布为答案.

I have a code part like

<a href="asda" class="urun_baslik">SOME TEXT </a>
I want that some text with webbrowser control.

I can use that getattribute("classname") and it returns urun_baslik.

So How can i get that SOME TEXT!

UPDATE:
OP found the answer himself and posted as an answer.

推荐答案

我相信HtmlElement.InnerText应该返回您要查找的文本.
I believe HtmlElement.InnerText should return the text you are looking for.


您可以使用innerHtml属性.您唯一需要给控件提供ID的东西

You can use innerHtml property. The only thing you have to give some ID for your control

document.getElementById(''controlid'').innerHTML


感谢您的回答,我自己找到了.
item.GetAttribute("classname")=="urun_baslik",然后item.OuterText帮助了我.
Thanks for ur answers i found it myself.
item.GetAttribute("classname") == "urun_baslik" then item.OuterText helped me.


这篇关于[已解决] c#Htmlelement类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆