How do I integrate these two conditions block codes to mine in Ruby?
问题 How do I integrate these two conditions if my code scrapes without them? My code is working already, but it scrapes all rows (non-bold and bold values) and doesn't scrape the title attribute string. Condition 1: parses a table row only if one of its fields is bold: doc = Nokogiri::HTML(html) doc.xpath('//table[@class="articulos"]/tr[td[5]/p/b]').each do |row| puts row.at_xpath('td[3]/text()') end Condition2: gets only the number off the title attribute string : doc = Nokogiri::HTML(html)