Ruby - Scraper concatenate strings
I'm making a ruby web scraper to gather some info. In the HTML of the page that i want to scrape there's 3 equal spans per article:
<small> foo bar</small>
Some of the articles don't have the last span.
For now i only have:
page.css('span.item-detail').each do |line|
I'm using Nokogiri and open-uri gems.
What i want is to concatenate the 3 spans (some articles only have two spans in the "item-detail" class) and print them in the screen, can anyone help me please?
Posted over 4 years ago by