ruby-nokogiri -xpath 用法说明

//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群,可交流。

猜你喜欢

转载自sitoto.iteye.com/blog/1615603