注意事项

索引

  • 从“一”, "1" 开始, 切记不是 0 开始

index, 位置函数

  • fn:position()
  • //p[position() < 3]

最后一个

fn:last()

提取所有标签下的文本

  • string 函数
  • string(./table/tr)
  • string(yourXpath)
  • response.xpath('./p')