def topics
  url ||= 'http://bbs.gfan.com/forum-274-1.html' 
  @agent.get url do |page|
    list= page.search('tbody[id^=normalthread] a.xst').each
  end
  def list.next
    begin
      self.next 
    rescue 
      topics (url.sub!(/\d+\.html/) {|m|"#{m.to_i + 1}.html" })
    end
  end
  list
end
想把 topics(即他的返回值) 做成一个迭代器,他的内容是抓取的网页上所有 a.xst 的链接 可以一直这样调用
topics.next
当所有的元素迭代完之后递归一下,参数里面表示页码的部分加一比如第二次
http://bbs.gfan.com/forum-274-2.html
但是我写的不好,而且有错误不能运行