def parse(page)
if page.body =~ /<\/strong> を含む動画はありません。/
@not_found = true
raise NotFound
end
@total_size = page.search('form[@name="sort"]//td[@class="TXT12"]//strong').first.inner_html.sub(/,/,'').to_i
@has_next = false
@has_prev = false
respages = page/'//div[@class="mb16p4"]//p[@class="TXT12"]//a'
puts_info respages.size
respages.each {|r| puts_info r.inner_html }
if respages.size > 0
respages.each {|text|
if text.inner_html =~ /前のページ/
@has_prev = true
end
if text.inner_html =~ /次のページ/
@has_next = true
end
}
end
result_xpath = page/'//div[@class="cmn_thumb_R"]//p[@class="TXT12"]/a[@class="video"]'
puts_info result_xpath.size.to_s
@videos = result_xpath.inject([]) {|arr, v|
vp = VideoPage.new(@agent, v.attributes['href'].sub(/watch\/(\w+)$/,'\1'))
vp.title = v.inner_html
arr << vp
}
end