0

我是海葵宝石的新手。我写了以下代码:

    anemone.on_every_page do |page|
      if page.url.to_s.match(/\-ad$/)
        unless page.url.to_s.match("restaurant|hotel")
          p "not useful url: #{page.url}"
          count += 1
          if count == 5
            break
          end
          next
        else
          count=0
        end
      end
    end

在 break 语句中,我得到localjumperror: break from proc-closure。我不知道如何解决这个问题。

4

0 回答 0