简体   繁体   English

HTTPUnit中HTML元素的字符串表示形式

[英]String representation of HTML element in HTTPUnit

Been trying to find a way of getting the String representation of an HTMLElement in HTTPUnit. 一直试图找到一种在HTTPUnit中获取HTMLElement的String表示形式的方法。 I'm using HTTPUnit in some tests to get response HTML, and can get the text content of an element, however this does not include a text representation of its surrounding HTML, which I want to compare with a test value. 我在某些测试中使用HTTPUnit来获取响应HTML,并且可以获取元素的文本内容,但是其中不包括其周围HTML的文本表示形式,我想将其与测试值进行比较。

Any help appreciated. 任何帮助表示赞赏。

The is more than one way to represent an HTML element. 表示HTML元素的方法不止一种。 For instance, the attributes of an HTML element can be in any order, so you could produce a string, but it is not guarantied to be identical to the original element. 例如,HTML元素的属性可以采用任何顺序,因此您可以生成一个字符串,但不能保证它与原始元素相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM