Parse table using Nokogiri

后端 未结 3 1291
一向
一向 2021-01-06 13:16

I would like to parse a table using Nokogiri. I\'m doing it this way

def parse_table_nokogiri(html)

    doc = Nokogiri::HTML(html)

    doc.search(\'table &         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 14:14

    Simple:

    doc.search('//td').each do |cell|
      puts cell.content
    end
    

提交回复
热议问题