---
title: "ruby-nokogiri -xpath 用法说明"
author: "sitoto"
date: "2012-08-01T14:14:56Z"
tags: ["xpath"]
categories: ["开源软件"]
slug: "ruby-nokogiri-xpath"
draft: false
lastmod: "2012-08-01T14:27:31Z"
id: 1615603
url: "https://sitoto.iteye.com/blog/1615603"
---

//div[@xxx = "sss"]/table[2]/tr[1]/td[1]/a/@href

上面那段代码的意思说清楚，基本上可以用xpath  解析html了。

xpath()
at_xpath()

做个记录先



参考资料：http://stackoverflow.com/questions/2683298/xpath-matching-attribute-and-content-of-an-element



193737895群，可交流。