开发者

Is it possible to construct an HTML page in which not all all elements are accessible via CSS selectors/XPaths?

开发者 https://www.devze.com 2023-03-25 17:00 出处:网络
In other word开发者_JAVA技巧s: Are there any HTML constructs that don\'t allow certain elements to be selected via CSS selectors?

In other word开发者_JAVA技巧s:

  • Are there any HTML constructs that don't allow certain elements to be selected via CSS selectors?
  • Are there any HTML constructs that don't allow certain elements to be selected via XPaths?

Thank you! :)


Are there any HTML constructs that don't allow certain elements to be selected via XPaths?

Yes, some examples:

<br>
<p>This is a paragraph.<p>This is another paragraph.
<em><strong>This is some text.</em></strong>
<td rowspan=3>blah</td>
<td rowspan='3">blah</td>
<title>Cars & Trucks</title>

There are some HTML to XHTML converters out there that will make it so you can use xPath. I have used this one in the past:

http://developer.mindtouch.com/SgmlReader

0

精彩评论

暂无评论...
验证码 换一张
取 消