IHTMLAttribute如何获取未修剪的值属性
我将 IHTMLDomNode 属性转换为 IHTMLDOMAttribute ,
IHTMLAttributeCollection attributes = (IHTMLAttributeCollection)childDomElement.attributes;
问题是当我使用 IHTMLDOMAttribute value 属性来获取特定元素节点的值时,它似乎在内部修剪了值字符串。因此,例如,如果选择像 class='wrong' 这样的属性值,则该属性值将返回 'wrong',这是错误的,因为它应该有空格。知道如何获得正确的名字吗?
I am casting an IHTMLDomNode attribute to IHTMLDOMAttribute
IHTMLAttributeCollection attributes = (IHTMLAttributeCollection)childDomElement.attributes;
the problem is that when I use IHTMLDOMAttribute value property to get the value of a particular element node, it seems to internally trim the value string. So for example if an attribute value like class=' wrong' is selected, then the attribute value would retunr 'wrong', which is wrong because it should have the blank space. Any idea how to get the right name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这是否有帮助,但据我了解,您可以执行以下操作。这是我在自己的特殊情况下用于检查或获取属性的方法。请随意使用此代码来帮助您指明正确的方向
I am not sure if this will help but from what I am understanding you could do something like the following.. here is what I would use in my own special case for checking or getting at Attributes. feel free to use this code to help point you in the right direction