English 中文(简体)
未能提取html表流
原标题:Failing to extract html table rows

“entergraph

我试图抽取上述表格中所列的所有五行。

Im利用Rubytcot图书馆,用Xpath表达方式抽取表流。

举例来说,Xpath表达方式一的使用是/html/ 本人/center/table/tr。 请注意,我从这一表述中删除了body子,这通常是成功提取的。

令人痛心的是,我已经走了头三头,导致最后两行失踪。 我对那里的情况没有任何想法。

EDIT:对法典没有mag,只是根据要求附上。

require  open-uri 
require  hpricot 

faculty = Hpricot(open("http://www.utm.utoronto.ca/7800.0.html"))
(faculty/"/html/body/center/table/tr").each do |text|
  puts text.to_s
end
最佳回答
问题回答

不存在以下途径:<条码>。 缩略语 当你使用<条码>、<<>/>>/代码>时,请重新专门寻找一个<条码><tr>, 它是<条码>的直系后代;table>,但从您的图像来看,该标志是如何构造的。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签