原来的方式是从根节点,一般是html开始逐一向下进行元素定位,这种方式唯一缺点在于整个xpath语句会很长,比如: /html/body ...
JavaScript provides several tools to help you do this. Use indexOf () to find the position of a specific value. It returns the first index where the value appears. Use lastIndexOf () to find the ...