我有这样的元素:
<span class="narrowValue"> (15,728)</span>
我是这样刮的:
@department_hash = Hash.new {|h,k| h[k]=[]}
department.css('.narrowValue').each do | department |
@department_hash["department"] << department.text
end
并得到这样的结果:
{"department"=>[" (15,725)", " (243,256)", " (510,337)", " (46,002)", " (14,109)", " (358)", " (5,787)", " (19,818)"]}
但我不需要括号。
我怎样才能只得到数字?