选择属性值与HTML敏捷性包 [英] Selecting attribute values with html Agility Pack
本文介绍了选择属性值与HTML敏捷性包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试从一个HTML文档中特定的图像,使用HTML敏捷性包和这个XPath:
I'm trying to retrieve a specific image from a html document, using html agility pack and this xpath:
//div[@id='topslot']/a/img/@src
据我所看到的,它找到的SRC属性,但它返回的IMG标签。这是为什么呢?
As far as I can see, it finds the src-attribute, but it returns the img-tag. Why is that?
我期望的innerHTML /的InnerText什么要设置的,但都是空的字符串。 OuterHtml被设置为完整的img标签
I would expect the InnerHtml/InnerText or something to be set, but both are empty strings. OuterHtml is set to the complete img-tag.
是否有任何文档的Html敏捷包?
Are there any documentation for Html Agility Pack?
推荐答案
的Html敏捷包的不支持的属性选择。
Html Agility Pack does not support attribute selection.
这篇关于选择属性值与HTML敏捷性包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文