html 表格 提取6,Nokogiri:解析,提取并返回<tr> HTML表格中的内容

我想解析一个HTML表格。它基本上是在HTML第六

标签:Nokogiri:解析,提取并返回 HTML表格中的内容date

this is my title

this is my subtitle

this is a line

this is a line

this is a line

this is a line

this is a line

this is a line

this is a line

this is a line

this is a line

我的Ruby代码看起来是这样的:

require 'nokogiri'

require 'open-uri'

url =

data = Nokogiri::HTML(open(url))

data.at('

').next[6].text

但它不会工作。我如何使用Nokogiri来提取所有这些

this is a line代码?

理想我想它是一个变量,包括HTML,我想,但它进入另一个网站。

非常感谢!

+1

欢迎堆栈溢出。这不是Sinatra代码,它是Ruby代码。而且,Sinatra标签是不需要的,因为你的问题中的代码不使用它。 –

2015-01-21 00:30:04

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值