[英]Can someone explain this javascript code to me?
var vTableExp = "//a[contains(@href,'newdid')]/ancestor::td/ancestor::tr/ancestor::tbody";
var vTable = dom.find(vTableExp, XPFirst);
thanks 谢谢
It finds the first tbody
which is an ancestor of aa tr
element which is an ancestor of a td
element which is an ancestor of an a
element whose href
contains the string newdid
. 它找到第一个tbody
,它是aa tr
元素的祖先,它是td
元素的祖先, td
元素是href
包含字符串newdid
a
元素的祖先。 (IOW, assuming that the parsed document is (X)HTML, select the body of the first table that has a cell containing a link whose address contains the string newdid
.) (IOW,假设已分析的文档是(X)HTML,请选择第一个表的正文,该表的主体具有一个包含链接的单元格,该链接的地址包含字符串newdid
。)
vTableExp
可能是一个regexp模式,然后正在搜索它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.