Guest User

Untitled

a guest
Feb 10th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. doc.css("#cat10 #forum46").each do |grab|
  2.   genre = grab.at_css(".forumtitle").text
  3.   subgenre = grab.css(".subforum a").text
  4.  
  5.   puts "#{genre}"
  6.   puts
  7.   puts "#{subgenre}"
  8.  
  9. end
  10.  
  11.  
  12. That code grabs the forum title, and all of the subforum titles under it. It returns them on one line
  13. without spaces. Tried to add a \n to
  14.  
  15.   puts "#{subgenre}\n"
  16.  
  17. Which did not work. Also tried to add the \n up top in the subgenre variable. How can I get the results to print separately?
Advertisement
Add Comment
Please, Sign In to add comment