I have the following HTML:
<div class="tvShow" align="left">
<div class="clearfix" style="margin:0px 0px;">
<h3 class="left" style="margin:0px 0px">FIRST TUESDAY BOOK CLUB WITH JENNIFER BYRNE</h3>
</div>
<div>Thursday 22nd December at 2.00 pm (60 minutes)</div>
<div><b>Channel: </b>ABC1</div>
...
</div>
I’m using the scrapi gem to scrape the contents.
This is what I have so far to extract the h3:
channel_item = Scraper.define do
process "h3", :name => :text
end
# let scrapi begin
listings = Scraper.define do
array :programs
process "div.tvShow", :programs => channel_item
result :programs
end
# loop through the listings
listings.scrape(uri).each do |program|
puts program.name.titleize # h3 text
end
I’m not entirely sure how to extract the Thursday 22nd December at 2.00 pm (60 minutes) and the Channel: ABC1 text.
Any help would be appreciated. Thanks in advance.
Try this:
http://saxon.sourceforge.net/saxon6.5.3/expressions.html#NodeSetExpressions
Hope this helps.