我正在嘗試使用Scrubyt從此頁獲取詳細信息http://www.nuffieldtheatre.co.uk/cn/events/event_listings.php?section=events。我已經設法從列表中獲取標題和詳細URL,但我無法使用next_page讓刮板進入下一頁。我認爲這是因爲我沒有爲下一頁鏈接使用正確的模式。我嘗試了字符串「Next Page」,並且我也嘗試了XPath。任何其他想法?如何獲得Scrubyt的「下一頁」鏈接
的代碼如下:
require 'rubygems'
require 'scrubyt'
nuffield_data = Scrubyt::Extractor.define do
fetch 'http://www.nuffieldtheatre.co.uk/cn/events/event_listings.php?section=events'
event do
title 'The Coast of Mayo'
#url "href", :type => :attribute
link_url
end
next_page "Next Page", :limit => 2
end
nuffield_data.to_xml.write($stdout,1)