how can print out title inside span tag?
when use
puts row.css('td.calendar__impact').css('span').title
it returns empty:
irb(main):063:0> rows.map |row| irb(main):064:1* puts row.css('td.calendar__impact').css('span') irb(main):065:1> end
using html:
<span title="low impact expected" class="low"></span> <span title="low impact expected" class="low"></span>
row.css('td.calendar__impact').css('span')
is returning array, might want loop though title span elements.
this how access attributes , title first span element:
row.css('td.calendar__impact').css('span')[0].attributes['title'].text
Comments
Post a Comment