Is it possible to construct an HTML page in which not all all elements are accessible via CSS selectors/XPaths?
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
精彩评论