This is something I wasn’t expecting.
I’m using anemone to count links in pages (anemone is a web spider framework for ruby)
Its pretty straightforward, but why won’t this work?
anemone.on_every_page do |page|
@myLinks =[]
page.links.each_with_index do |link,index|
puts "HOWDY PARDNER"
@tempLink =(link.to_s + ",")
@myLinks[index] = @tempLink
end
end
The part in question is the addition of link.to_s +”,”
The reason I’m doing this addition is that links.to_s comes down as an entire string with no spaces. I’d like to sepsrate them with a , so I can use .split() later.
to split (you mean
join?) them later you don’t need to add “,”:That’s all you need, I think.